RayeR CZ, 26.03.2010, 01:14 |
Multiplatform makefile for gcc (Developers) |
Could someone give me an idea how to detect OS from makefile? I have some sources that I'm compiling with DJGPP, MinGW32 and Linux gcc. I need to link it with some OS specific libraries so I need to detect OS and use proper -l arguments and then just type "make" without different options. In C source I can simply use e.g. #ifdef __WIN32__ but make probably doesn't have something similar. It would need to call some other utility for OS detection but how this utility will run under all OSes? I can also got rough guess by testing specific environment variables e.g. "WINDIR". Or maybe grepping output of "gcc -v" (I have set proper path to compiler). But maybe it's bad idea and I should rather make 3 scripts maked, makew, makel which will call make with some args... --- |
Rugxulo Usono, 26.03.2010, 03:56 (edited by Rugxulo, 26.03.2010, 19:39) @ RayeR |
Multiplatform makefile for gcc |
> Could someone give me an idea how to detect OS from makefile? I have some --- |
marcov 26.03.2010, 14:20 @ RayeR |
Multiplatform makefile for gcc |
> Could someone give me an idea how to detect OS from makefile? |
Rugxulo Usono, 26.03.2010, 19:35 @ marcov |
Multiplatform makefile for gcc |
> > Could someone give me an idea how to detect OS from makefile? --- |
RayeR CZ, 29.03.2010, 01:23 @ Rugxulo |
Multiplatform makefile for gcc |
Thanks for all suggestions. After some thinking it seems that --- |