corrected OS detection

This commit is contained in:
Christian Kroll 2013-01-04 05:43:36 +00:00
parent e1949be8cd
commit 987192e2b0
2 changed files with 21 additions and 9 deletions

View File

@ -30,12 +30,16 @@ LDFLAGS += -T ./avr5.x -Wl,-Map,image.map -mmcu=$(MCU)
############################################################################# #############################################################################
#Settings for Simulator build #Settings for Simulator build
CYGWINTYPE = $(shell echo $$OSTYPE) #ugly hack to define a newline (yes, there are two blank lines, on purpose!!)
define n
endef
OSTYPE = $(shell uname) OSTYPE = $(shell uname)
MACHINE = $(shell uname -m) MACHINE = $(shell uname -m)
#$(info $(OSTYPE))
ifeq ($(CYGWINTYPE),cygwin) ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN)
CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 -D_WIN32 -D_XOPEN_SOURCE=600 CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 -D_WIN32 -D_XOPEN_SOURCE=600
LDFLAGS_SIM = -T simulator/i386pe.x LDFLAGS_SIM = -T simulator/i386pe.x
LIBS_SIM = -lgdi32 -lwinmm -lm LIBS_SIM = -lgdi32 -lwinmm -lm
@ -49,6 +53,7 @@ else
endif endif
LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm
else else
ifeq ($(OSTYPE),Linux)
CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 -D_XOPEN_SOURCE=600 CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 -D_XOPEN_SOURCE=600
ifeq ($(MACHINE),x86_64) ifeq ($(MACHINE),x86_64)
LDFLAGS_SIM = -g -T simulator/elf_x86_64.x LDFLAGS_SIM = -g -T simulator/elf_x86_64.x
@ -56,6 +61,13 @@ else
LDFLAGS_SIM = -T simulator/elf_i386.x LDFLAGS_SIM = -T simulator/elf_i386.x
endif endif
LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm
else
($(error $(n)$(n)Simulator build is not supported on your system.$(n)$(n)\
Currently supported platforms:$(n) \
Linux on x86 and amd64$(n) \
FreeBSD on x86 and amd64$(n) \
Windows (through Cygwin) on x86 and amd64)
endif
endif endif
endif endif

View File

@ -3,7 +3,7 @@ TOPDIR = ..
include $(TOPDIR)/defaults.mk include $(TOPDIR)/defaults.mk
ifeq ($(OSTYPE),cygwin) ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN)
SRC_SIM = winmain.c eeprom.c SRC_SIM = winmain.c eeprom.c
else else
SRC_SIM = main.c trackball.c eeprom.c SRC_SIM = main.c trackball.c eeprom.c