Default [EXPERIMENT] Building CM11 on Cygwin

I know, I know. I'm probably gonna get a lot of "it can't be done and this is why" if what I've googled is any indication. However, difficult does not equate to impossible.

Firstly, one of the big messages I encountered online was that windows is not case sensitive, thus it can't be done even if you had a toolchain. However, it's entirely possible to turn windows 100% case sensitive (i've got cygwin mkdir Abc and aBc to prove it)

So to do this, go to control panel / programs / turn windows features on or off.

When opened, check the box that says "subsystem for UNIX-based applications" and hit okay.

Now open a browser window. Download This.

Install it, and on options near the beginning of the install check EVERYTHING.

Reboot at the end of the installation. Windows is now fully case-sensitive.

So now, after repo sync and running through the motions (get-prebuilts, breakfast, extract-files, etc)

I now encounter problem number two. Javac: command not found.

So to get around this, download an unofficial build of openjdk-1.7.0 and manually drop it in cygwin.

So after this, I type brunch d2lte

I now encounter problem number three. Build info comes up but ends abruptly at

bash: schedtool: command not found

or something like that anyway. Googling schedtool reveals information about what it does. So, to get rid of the error message, I create a dummy schedtool binary and drop it in cygwin's bin folder. Doesn't fix the build, but makes that nasty error go away.


So now, both brunch and mka will display build info then return you promptly to the command line with no error. However, what does work is the "make" command.

So, I type make bootimage.

Here comes problem number 4.

I get an error message for build/core/java.mk on line 23, saying my target SDK is invalid (here's my version), (here's available)
or something like that.

So to fix, open build/core/java.mk in notepad++, navigate to line 23, and remove the following
Code:
   
 $(error $(LOCAL_PATH): Invalid LOCAL_SDK_VERSION '$(LOCAL_SDK_VERSION)' \
             Choices are: $(TARGET_AVAILABLE_SDK_VERSIONS))
    else
After which, your build will move forward to..... error number 5
Code:
make: *** No rule to make target '/home/Swisgaar/android/system/out/host/windows-x86/bin/mkbootimg.exe', needed by '/home/Swisgaar/android/system/out/target/product/d2lte/boot.img'.  Stop.

Which i fixed, by downloading a .exe version of mkbootimg and dropping it in system/out/host/windows-x86/bin manually, which you can get from here.


After which, moving on to the next error, and the one i'm currently stuck on,

Code:
make[1]: Entering directory '/home/Swisgaar/android/system/kernel/samsung/d2'
/home/Swisgaar/android/system/kernel/samsung/d2/Makefile:327: /home/Swisgaar/android/system/kernel/samsung/d2/scripts/Kbuild.include: No such file or directory
make: *** empty variable name.  Stop.
/home/Swisgaar/android/system/kernel/samsung/d2/Makefile:416: recipe for target 'scripts_basic' failed
make[2]: *** [scripts_basic] Error 2
Makefile:130: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/home/Swisgaar/android/system/kernel/samsung/d2'
build/core/tasks/kernel.mk:169: recipe for target '/home/Swisgaar/android/system/out/target/product/d2lte/obj/KERNEL_OBJ/.config' failed
make: *** [/home/Swisgaar/android/system/out/target/product/d2lte/obj/KERNEL_OBJ/.config] Error 2

Currently working on a fix. Any help is appreciated.

This experiment really isn't necessary, but it's just that, an experiment. I figure, this is my hobby, so why not.
Death to all but metal.
If you like my work, why not hit that thanks button?

If you REALLY like my work and want to contribute, why not buy me a beer?

My rom: