Browse Source

corrected OS detection

feature/2015
Christian Kroll 12 years ago
parent
commit
987192e2b0
  1. 28
      defaults.mk
  2. 2
      simulator/Makefile

28
defaults.mk

@ -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,13 +53,21 @@ else
endif endif
LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm
else else
CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 -D_XOPEN_SOURCE=600 ifeq ($(OSTYPE),Linux)
ifeq ($(MACHINE),x86_64) CFLAGS_SIM = -g -Wall -pedantic -std=c99 -O0 -D_XOPEN_SOURCE=600
LDFLAGS_SIM = -g -T simulator/elf_x86_64.x ifeq ($(MACHINE),x86_64)
LDFLAGS_SIM = -g -T simulator/elf_x86_64.x
else
LDFLAGS_SIM = -T simulator/elf_i386.x
endif
LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm
else else
LDFLAGS_SIM = -T simulator/elf_i386.x ($(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
LIBS_SIM = -lglut -lpthread -lGL -lGLU -lm
endif endif
endif endif

2
simulator/Makefile

@ -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

Loading…
Cancel
Save