diff --git a/3rdParty/misc/src/Makefile b/3rdParty/misc/src/Makefile index 55892f7..ddf7a26 100755 --- a/3rdParty/misc/src/Makefile +++ b/3rdParty/misc/src/Makefile @@ -79,7 +79,7 @@ testbp: testbp.cc boolPack.cc ../include/boolPack.h testdouble33s: testdouble33s.cc double33s.cc ../include/double33s.h lib - $(CXX) -o testdouble33s $(SPECFLAGS) $(CCFLAGS) $(OPTFLAGS4) $(MINCLUDE) testdouble33s.cc \ + $(CXX) -o testdouble33s $(SPECFLAGS) $(CXXFLAGS) $(OPTFLAGS4) $(MINCLUDE) testdouble33s.cc \ ../lib/$(ABI)/libmisc.a \ -lm diff --git a/FMIWrapper/Makefile b/FMIWrapper/Makefile index 678863c..d235700 100644 --- a/FMIWrapper/Makefile +++ b/FMIWrapper/Makefile @@ -17,12 +17,8 @@ endif include $(MAKEFILEHEADHOME)/Makefile.head -# For microsoft and Dymola -#CC=mycl cl -DWIN32 -D_WIN32 -DXMSTATIC -DYY_NEVER_INTERACTIVE /EHsc -#cc=mycl cl -DWIN32 -D_WIN32 -DXMSTATIC -DYY_NEVER_INTERACTIVE /EHsc - override CC += -pipe -O2 -frtti -Wall -Wextra -fexceptions -DUNICODE -DINTERFACE_TYPES -override CXX += -pipe -O2 -frtti -Wall -Wextra -fexceptions -DUNICODE -DINTERFACE_TYPES -std=c++11 +override CXX += -pipe -O2 -frtti -Wall -Wextra -fexceptions -DUNICODE -DINTERFACE_TYPES # deal with regex crap ifeq (gcc,$(findstring gcc,$(CC))) diff --git a/Makefile.head b/Makefile.head index 9c4153a..bd78fb7 100644 --- a/Makefile.head +++ b/Makefile.head @@ -13,9 +13,9 @@ endif ifeq ($(ABI),WINDOWS64) ifeq (MINGW64,$(findstring MINGW64,$(shell uname))) - CC=g++ - cc=gcc - LINK=g++ + CC=gcc + CXX=g++ + LINK=$(CXX) AR=ar CP=cp FEXT=.exe @@ -36,9 +36,9 @@ ifeq ($(ABI),WINDOWS64) endif else ifeq ($(ABI),WINDOWS32) ifeq (MINGW32,$(findstring MINGW32,$(shell uname))) - CC=g++ - cc=gcc - LINK=g++ + CC=gcc + CXX=g++ + LINK=$(CXX) AR=ar CP=cp FEXT=.exe @@ -52,9 +52,9 @@ else ifeq ($(ABI),WINDOWS32) $(error No compiler found to build for WINDOWS32) endif else ifeq ($(ABI),MAC64) - CC=g++ - cc=gcc - LINK=g++ + CC=gcc + CXX=g++ + LINK=$(CXX) AR=ar CP=cp SHREXT=.dylib @@ -63,9 +63,9 @@ else ifeq ($(ABI),MAC64) CMAKE_TARGET="-G Unix Makefiles" INSTALL_DIR = install/mac else - CC=g++ - cc=gcc - LINK=g++ + CC=gcc + CXX=g++ + LINK=$(CXX) AR=ar CP=cp SHREXT=.so @@ -81,6 +81,28 @@ TIMEHOME=$(UP)/extralibs/rtime DEFINES= -DUSE_THREADS OPTFLAGS4=-O2 +TARGET_TRIPLE := $(subst -, ,$(shell $(CC) -dumpmachine)) +TARGET_ARCH := $(word 1,$(TARGET_TRIPLE)) +TARGET_OS := $(word 3,$(TARGET_TRIPLE)) + +EXTRAFLAGS = +ifeq ($TARGET_OS,mingw32) +else ifeq ($TARGET_OS,cygwin) +else +EXTRAFLAGS = -fPIC +endif + +detected_OS := $(shell uname -s) +ifeq ($(detected_OS),Darwin) +EXTRAFLAGS += -DNO_RTIME +RTIMELIB = +else +RTIMELIB = -lrtime +endif + +override CC += $(CFLAGS) $(EXTRAFLAGS) +override CXX += $(CXXFLAGS) -std=c++11 $(EXTRAFLAGS) + ifeq (MINGW64,$(findstring MINGW64,$(shell uname))) INCLXML-WINDOWS64=-I$(OMDEV)/tools/msys/mingw64/include/libxml2 LIBXML-WINDOWS64=-L$(OMDEV)/tools/msys/mingw64/bin -lxml2-2 diff --git a/Modelica/Makefile b/Modelica/Makefile index 9203c2a..653c875 100644 --- a/Modelica/Makefile +++ b/Modelica/Makefile @@ -17,12 +17,8 @@ endif include $(MAKEFILEHEADHOME)/Makefile.head -# For microsoft and Dymola -#CC=mycl cl -DWIN32 -D_WIN32 -DXMSTATIC -DYY_NEVER_INTERACTIVE /EHsc -#cc=mycl cl -DWIN32 -D_WIN32 -DXMSTATIC -DYY_NEVER_INTERACTIVE /EHsc - -CC += -std=c++11 -DYY_NEVER_INTERACTIVE -fPIC -cc += -std=c++11 -DYY_NEVER_INTERACTIVE -fPIC +override CC += -DYY_NEVER_INTERACTIVE +override CXX += -DYY_NEVER_INTERACTIVE ################################################################################# # @@ -42,19 +38,19 @@ INCLUDES= -I. \ -I$(MISCHOME)/include $(ABI)/%.o: %.c - $(cc) $(INCLUDES) -c $< -o $@ + $(CC) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: %.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: ../common/%.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: $(MISCHOME)/src/%.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: $(MISCHOME)/src/%.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ OBJS= tlmforce.o diff --git a/OMFMISimulatorWrapper/Makefile b/OMFMISimulatorWrapper/Makefile index ed58bfe..5f6986b 100644 --- a/OMFMISimulatorWrapper/Makefile +++ b/OMFMISimulatorWrapper/Makefile @@ -17,13 +17,6 @@ endif include $(MAKEFILEHEADHOME)/Makefile.head -# For microsoft and Dymola -#CC=mycl cl -DWIN32 -D_WIN32 -DXMSTATIC -DYY_NEVER_INTERACTIVE /EHsc -#cc=mycl cl -DWIN32 -D_WIN32 -DXMSTATIC -DYY_NEVER_INTERACTIVE /EHsc - -CC := $(CC) -pipe -O2 -frtti -Wall -Wextra -fexceptions -DUNICODE -DINTERFACE_TYPES -std=c++11 -cc := $(cc) -pipe -O2 -frtti -Wall -Wextra -fexceptions -DUNICODE -DINTERFACE_TYPES -std=c++11 - BNAME=OMFMISimulatorWrapper$(FEXT) MISCHOME=../3rdParty/misc @@ -37,16 +30,16 @@ LIBS = -L${OMFMISimulatorPath}/install/lib \ -lfmilib_shared $(ABI)/%.o: %.cpp - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: ../common/%.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: $(MISCHOME)/src/%.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: $(MISCHOME)/src/%.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ OBJS= main.o diff --git a/OpenModelica/Makefile b/OpenModelica/Makefile index 9398777..925717b 100644 --- a/OpenModelica/Makefile +++ b/OpenModelica/Makefile @@ -21,8 +21,8 @@ include $(MAKEFILEHEADHOME)/Makefile.head #CC=mycl cl -DWIN32 -D_WIN32 -DXMSTATIC -DYY_NEVER_INTERACTIVE /EHsc #cc=mycl cl -DWIN32 -D_WIN32 -DXMSTATIC -DYY_NEVER_INTERACTIVE /EHsc -CC += -std=c++11 -DYY_NEVER_INTERACTIVE -fPIC -DINTERFACE_TYPES -cc += -DYY_NEVER_INTERACTIVE -fPIC -DINTERFACE_TYPES +override CC += -DYY_NEVER_INTERACTIVE -DINTERFACE_TYPES +override CXX += -DYY_NEVER_INTERACTIVE -DINTERFACE_TYPES ################################################################################# # @@ -42,16 +42,16 @@ INCLUDES= -I. \ -I$(MISCHOME)/include $(ABI)/%.o: %.c - $(cc) $(INCLUDES) -c $< -o $@ + $(CC) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: %.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: ../common/%.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: $(MISCHOME)/src/%.cc - $(CC) $(INCLUDES) -c $< -o $@ + $(CXX) $(INCLUDES) -c $< -o $@ OBJS= tlmforce.o diff --git a/Simulink/Makefile b/Simulink/Makefile index 5d26e2f..b7cbbff 100644 --- a/Simulink/Makefile +++ b/Simulink/Makefile @@ -25,19 +25,18 @@ INCLUDES= -I. \ MISCHOME=../3rdParty/misc MEX_DEBUGFLG= -CC += -fPIC -std=c++11 $(ABI)/%.o: %.c - $(cc) $(DEFINES) $(CFLAGS) -DWIN32 $(OPTFLAGS4) $(INCLUDES) -c $< -o $@ + $(CC) $(DEFINES) $(CFLAGS) -DWIN32 $(OPTFLAGS4) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: %.cc - $(CC) $(DEFINES) $(CCFLAGS) -DWIN32 $(OPTFLAGS4) $(INCLUDES) -c $< -o $@ + $(CXX) $(DEFINES) $(CXXFLAGS) -DWIN32 $(OPTFLAGS4) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: ../common/%.cc - $(CC) $(DEFINES) $(CCFLAGS) -DWIN32 $(OPTFLAGS4) $(INCLUDES) -c $< -o $@ + $(CXX) $(DEFINES) $(CXXFLAGS) -DWIN32 $(OPTFLAGS4) $(INCLUDES) -c $< -o $@ $(ABI)/%.o: $(MISCHOME)/src/%.cc - $(CC) $(DEFINES) $(CCFLAGS) -DWIN32 $(OPTFLAGS4) $(INCLUDES) -c $< -o $@ + $(CXX) $(DEFINES) $(CXXFLAGS) -DWIN32 $(OPTFLAGS4) $(INCLUDES) -c $< -o $@ OBJS= diff --git a/common/Makefile b/common/Makefile index ad8bce7..d9857f3 100644 --- a/common/Makefile +++ b/common/Makefile @@ -15,28 +15,6 @@ include $(MAKEFILEHEADHOME)/Makefile.head MISCHOME = ../3rdParty/misc TIMEHOME = ../3rdParty/rtime -TARGET_TRIPLE := $(subst -, ,$(shell $(CC) -dumpmachine)) -TARGET_ARCH := $(word 1,$(TARGET_TRIPLE)) -TARGET_OS := $(word 3,$(TARGET_TRIPLE)) - -EXTRAFLAGS = -ifeq ($TARGET_OS,mingw32) -else ifeq ($TARGET_OS,cygwin) -else -EXTRAFLAGS = -fPIC -endif - -detected_OS := $(shell uname -s) -ifeq ($(detected_OS),Darwin) -EXTRAFLAGS += -DNO_RTIME -RTIMELIB = -else -RTIMELIB = -lrtime -endif - -override CC += $(CFLAGS) -std=c++11 $(EXTRAFLAGS) -override CXX += $(CXXFLAGS) -std=c++11 $(EXTRAFLAGS) - SRCCLT= Plugin/PluginImplementer.cc \ Plugin/MonitoringPluginImplementer.cc \ Communication/TLMClientComm.cc \ @@ -185,7 +163,7 @@ $(ABI)/testapp$(FEXT): $(ABI)/TLMTestApp.o $(LINK) $(ABI)/TLMTestApp.o -o $(ABI)/testapp$(FEXT) -L$(ABI) -lTLM $(LIBS) $(XTRLIBS) $(LIBPTHREAD) $(ABI)/%.o: %.cc - $(CC) $(DEFINES) $(CCFLAGS) $(OPTFLAGS4) $(INCLUDES) $(INCLXML) -c $< -o $@ + $(CXX) $(DEFINES) $(CXXFLAGS) $(OPTFLAGS4) $(INCLUDES) $(INCLXML) -c $< -o $@ .PHONY: clean dir depend lib manager test