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...
---
DOS gives me freedom to unlimited HW access.
Complete thread:
- Multiplatform makefile for gcc - RayeR, 26.03.2010, 01:14 (Developers)
- Multiplatform makefile for gcc - Rugxulo, 26.03.2010, 03:56
- Multiplatform makefile for gcc - marcov, 26.03.2010, 14:20
- Multiplatform makefile for gcc - Rugxulo, 26.03.2010, 19:35
- Multiplatform makefile for gcc - RayeR, 29.03.2010, 01:23
- Multiplatform makefile for gcc - Rugxulo, 26.03.2010, 19:35