X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=support%2Fmake%2Fsim.extra;h=8e6e92c5196a4fbb611bb37cd98a30cbb5854c0c;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=e2525ca7e0512f6086b2724b7ce9bfe2a233196d;hpb=1a329382c4f4556fd52d85f4e3f4a67e54911682;p=tinyos-2.x.git diff --git a/support/make/sim.extra b/support/make/sim.extra index e2525ca7..8e6e92c5 100644 --- a/support/make/sim.extra +++ b/support/make/sim.extra @@ -1,13 +1,13 @@ #-*-Makefile-*- vim:syntax=make #$Id$ -GCC=gcc +export GCC=gcc GPP=g++ OPTFLAGS = -g -O0 LIBS = -lm -lstdc++ -PFLAGS += -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\) +PFLAGS += -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\) -fnesc-gcc=$(GCC) WFLAGS = -Wno-nesc-data-race -PYTHON_VERSION=2.4 +PYTHON_VERSION=2.5 BUILDDIR = simbuild/$(PLATFORM) CFILE = $(BUILDDIR)/sim.c @@ -18,23 +18,28 @@ HASHFILE = $(TOSDIR)/lib/tossim/hashtable.c HASHOBJFILE = $(BUILDDIR)/c-support.o PYFILE = $(TOSDIR)/lib/tossim/tossim_wrap.cxx PYOBJFILE = $(BUILDDIR)/pytossim.o -PYDIR =/usr/include/python$(PYTHON_VERSION) +PYDIR = $(shell python$(PYTHON_VERSION)-config --prefix)/include/python$(PYTHON_VERSION) SIMDIR =$(TOSDIR)/lib/tossim XML = app.xml DUMPTYPES = -fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags -ifeq ($(OSTYPE), cygwin) +ifeq ($(findstring cygwin, $(OSTYPE)),cygwin) PLATFORM_FLAGS=-DUSE_DL_IMPORT -fpic SHARED_OBJECT=_TOSSIM.dll PLATFORM_BUILD_FLAGS= -fpic -W1,--enabled-auto-image-base - PLATFORM_LIB_FLAGS = -L/$(PYDIR)/config -lstdc++ -lpython$(PYTHON_VERSION) + PLATFORM_LIB_FLAGS = -L/usr/lib/python$(PYTHON_VERSION)/config -L/$(PYDIR)/config -lstdc++ -lpython$(PYTHON_VERSION) else -ifeq ($(OSTYPE), darwin) - PLATFORM_FLAGS=-fPIC - PLATFORM_CC_FLAGS=-bundle - SHARED_OBJECT=_TOSSIMmodule.so - PLATFORM_BUILD_FLAGS=-flat_namespace -undefined supress - PLATFORM_LIB_FLAGS = -lstdc++ +ifeq ($(OS), Windows_NT) # Some TinyOS installs are like this + PLATFORM_FLAGS=-DUSE_DL_IMPORT -fpic + SHARED_OBJECT=_TOSSIM.dll + PLATFORM_BUILD_FLAGS= -fpic -W1,--enabled-auto-image-base + PLATFORM_LIB_FLAGS =-shared -L/usr/lib/python$(PYTHON_VERSION)/config -L/$(PYDIR)/config -lstdc++ -lpython$(PYTHON_VERSION) +else +ifeq ($(findstring darwin, $(OSTYPE)), darwin) + SIM_DARWIN=TRUE +else +ifeq ($(findstring Darwin, $(shell uname)), Darwin) + SIM_DARWIN = TRUE else # linux PLATFORM_FLAGS=-shared -fPIC SHARED_OBJECT=_TOSSIMmodule.so @@ -42,7 +47,16 @@ else # linux PLATFORM_BUILD_FLAGS= -shared -fPIC endif endif - +endif +endif +ifdef SIM_DARWIN + PLATFORM_FLAGS=-fPIC -D_FORTIFY_SOURCE=0 + PLATFORM_CC_FLAGS=-bundle + SHARED_OBJECT=_TOSSIMmodule.so + PLATFORM_BUILD_FLAGS=-flat_namespace -undefined suppress + PLATFORM_LIB_FLAGS = -lstdc++ +endif + BUILD_DEPS = sim-exe # lib/tossim has to come at the end in order to ensure basic TOSSIM