building kernel from github using Ubuntu wsl and windows 10

I have, for the past 3 days, been trying to get wireless access to my internet with FreeBSD. Yesterday, I got a dongle that IS supported by FreebSD via the rtwn drivers. Unfortunately for me, I need to access the drivers here, rtwn_usb(4). If you notice this has no option for boot time loading, and I need to use the kernel build options to enable it. I can not for the life of me figure out why I am getting: Makefile:122: *** missing separator. Stop. whenever I run 'make buildkernel=GENERIC'. I simply git cloned the repo doing 'git clone https://github.com/freebsd/freebsd-src.git' THEN i cded into the freebsd-src directory that was created. Lastly, ran the command 'make buildkernel=GENERIC'. Since i was originally using WSL2 (Ubuntu), I was wondering if it was an OS issue, so i tried on windows 10 and it did not work/gave me the exact same error. After doing some research, it seems that it is given to me because of incorrect indentation (make is a bit like python as far as i've read). For others, they can make the kernel straight out of the box from github without any issues; BUT, they all seem to be using freebsd to build/install it anyways. Again, trying to fix the issue, i opened the makefile and at line 122 i see this:
.if defined(UNIVERSE_TARGET) || defined(MAKE_JUST_WORLDS) || defined(WITHOUT_KERNELS)
__DO_KERNELS=no
.endif
I have not been able to get rid of the error or even make it change the "122" number by messing with the indentations (tabbing, spacing one by one). Is there a way to solve the issue easily/ is there a way to get the drivers without internet on my freebsd system, or without having to build the kernel again?
 
Building FreeBSD itself is only supported on FreeBSD. The problem you seem to be facing right now is the difference between FreeBSD's make(1) and GNU's gmake(1).
 
Lastly, ran the command 'make buildkernel=GENERIC'.
Amazingly, this command is wrong as well, buildkernel is a target, not a variable. Make variables are all uppercase by convention.

So, once you do the correct thing and build on FreeBSD, just follow the handbook.

BTW, make features are just the tip of the iceberg (although an important one, "portable make", the common denominator understood by all flavors of make, can do very little and isn't suitable for manually written Makefiles of a large project).

Building an operating system always involves the build tools of this operating systems. It's often possible to create some cross-build environment on a different operating system, but that's a pretty complex thing to do.

What's your reason trying to build on a different OS?
 
Back
Top