Multiplatform makefile for gcc (Developers)
Thanks for all suggestions. After some thinking it seems that
gcc -dumpmachine
is the best choice for me. So I added following into my makefile:
CCSYSTEM = $(shell $(CC) -dumpmachine)
to get current compiler platform (path is set) and then decide target filename:
# Files
PROGNAME = SPIPGM
ifeq ($(findstring mingw32, $(CCSYSTEM)), mingw32)
PROGNAME = SPIPGMW
endif
ifeq ($(findstring cygwin, $(CCSYSTEM)), cygwin)
PROGNAME = SPIPGMW
endif
PROGEXT = EXE
ifeq ($(findstring linux, $(CCSYSTEM)), linux)
PROGEXT =
endif
BTW I wonder if make is too silly that don't know logical operators to be able to write
ifeq ($(findstring mingw32, $(CCSYSTEM)), mingw32) || ($(findstring cygwin, $(CCSYSTEM)), cygwin)
or even simpler if multiple substring search possible
infeq ($(findstring mingw32 cygwin ..., $(CCSYSTEM)), )
condition in one line but probably I missed that - not a make guru ;)
---
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