Date: 5/5/2006
| In the process of working on a cross platform Mutex written with inline assembly I had to peer into the bowels of gcc, cygwin and mingw to work out how to build threaded win32 apps with free software tools. So a number of pleasant things have occured in doing so.
Firstly I can now build Lgi applications with both cygwin AND mingw. Prior to today I didn't even know the different between cygwin and mingw. However I'm now in the "know" and have separate makefiles for each. Sweet.
Secondly I discovered almost by accident how to craft makefiles that replicate the Visual C++ functionality to a 't'. Something that has eluded me for some 4 years now! Ever since I started development on Linux I've been trying to build a makefile system that works the same as the Visual C++ build system I am used to. And finally I've done it. The last thing I had to fix was the creation of output file directories. That particular feat while obvious for makefile gurus always was an annoying "hack" in my makefiles. I used to have a prereq on my final target rule that called the mkdir command:
target : makeoutputfolder $(deps)
...link command...
makeoutputfolder :
mkdir $(outfolder)
But this had the unfortunate side effect of relinking the target every time, even if no dependencies had changed. So enter the solution:
target : $(outfolder) $(deps)
...link command...
$(outfolder) :
mkdir $(outfolder)
I know it seems simple but, hey the documentation is er... rather obtuse. Other than that, I've given up on wildcard rules to build source and now I get LgiIde to generate all the deps and write out rules for every source file in the project. This is garrenteed to work and you can nail the right source file even when multiple different source files have the same name. Sometimes brute force is called for and when your as dumb as GNU make that is definately true. And before you have a go at me for not using %build tool Y%, I use make simply because it's on every system under the sun and it's nice to be able to unpack my source and just build it. It's a lowest common denomiator thing.
Anyway, Lgi now supports mingw and cygwin. For all your licensing needs.
|