This repository has been archived by the owner on May 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
/
Makefile.omsi.common
114 lines (85 loc) · 4.35 KB
/
Makefile.omsi.common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Makefile for build omsi base libraries
# Specify a list of target platforms, including dynamic, static
PLATFORMS=static dynamic
CMAKE_FLAGS=-DCMAKE_BUILD_TYPE=$(BUILDTYPE)
CMAKE_CALL=cmake -G $(CMAKE_TARGET) --build . -DPLATFORM=$(PLATFORM) $(CMAKE_FLAGS) $(IS_MINGW32) $(IS_MINGW64) -DCMAKE_INSTALL_PREFIX:PATH="$(OMBUILDDIR)" -DLIB_OMC=$(LIB_OMC) ..
.PHONY: OMSIBaseClean OMSICClean
#############################
# Rules for OMSI
#############################
OMSI: OMSIBaseInstall OMSICInstall
OMSI-clean: OMSIBaseClean OMSICClean
cd $(OMBUILDDIR); \
rm -rf include/omc/omsi include/omc/omsic; \
rm -rf $(LIB_OMC)/omsi;
#############################
# Rules for OMSIBase library
#############################
OMSIBase: sundials fmil
cd SimulationRuntime/OMSI; \
$(foreach PLATFORM, $(PLATFORMS), \
mkdir -p Build_$(PLATFORM); \
(cd ./Build_$(PLATFORM); echo "change to Build_$(PLATFORM)"; \
$(CMAKE_CALL); \
$(MAKE) );)
OMSIBaseMSVC: getMSVCversion
test -f """${VSCOMNTOOLS}/../../VC/vcvarsall.bat"""
echo 'Build the cppRuntime with MSVC' buildtype: $(BUILDTYPE)
#rm -rf Build_MSVC
mkdir -p Build_MSVC
echo call '"${VSCOMNTOOLS}\\..\\..\\VC\\vcvarsall.bat" ${VCVARS_PARAMS}' > Build_MSVC/build.bat
echo echo Running CMake from '%OMDEV%\\bin\\cmake\\bin\\cmake' >> Build_MSVC/build.bat
echo '%OMDEV%\\bin\\cmake\\bin\\cmake -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DPLATFORM="dynamic" $(CMAKE_FLAGS) -DIS_MINGW32=OFF -DIS_MINGW64=OFF -DCMAKE_INSTALL_PREFIX:PATH=./tmp ../ -G "NMake Makefiles JOM" -D"CMAKE_MAKE_PROGRAM:PATH=%OMDEV%\\tools\\jom\\jom.exe"' >> Build_MSVC/build.bat
# for some reason, the environment variable 'MAKEFLAGS' was set to 'w' on my and Niklas' machine?!
echo set MAKEFLAGS="" >> Build_MSVC/build.bat
echo echo Running NMake JOM >> Build_MSVC/build.bat
echo %OMDEV%\\tools\\jom\\jom.exe /f Makefile install >> Build_MSVC/build.bat
cd ./Build_MSVC; echo "change to Build_MSVC";\
cmd /c build.bat
echo 'Build cppRuntime (static) with MSVC'
#rm -rf Build_MSVC_static
mkdir -p Build_MSVC_static
echo call '"${VSCOMNTOOLS}\\..\\..\\VC\\vcvarsall.bat" ${VCVARS_PARAMS}' > Build_MSVC_static/build.bat
echo echo Running CMake from '%OMDEV%\\bin\\cmake\\bin\\cmake' >> Build_MSVC_static/build.bat
echo '%OMDEV%\\bin\\cmake\\bin\\cmake -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DPLATFORM="static" $(CMAKE_FLAGS) -DIS_MINGW32=OFF -DIS_MINGW64=OFF -DCMAKE_INSTALL_PREFIX:PATH=./tmp ../ -G "NMake Makefiles JOM" -D"CMAKE_MAKE_PROGRAM:PATH=%OMDEV%\\tools\\jom\\jom.exe"' >> Build_MSVC_static/build.bat
# for some reason, the environment variable 'MAKEFLAGS' was set to 'w' on my and Niklas' machine?!
echo set MAKEFLAGS="" >> Build_MSVC_static/build.bat
echo echo Running NMake JOM >> Build_MSVC_static/build.bat
echo %OMDEV%\\tools\\jom\\jom.exe /f Makefile install >> Build_MSVC_static/build.bat
cd ./Build_MSVC_static; echo "change to Build_MSVC_static";\
cmd /c build.bat
# move folder to build dir
cp -R --verbose Build_MSVC/tmp/* $(builddir_build)
cp -R --verbose Build_MSVC_static/tmp/lib/* $(builddir_build)/lib
OMSIBaseInstall: OMSIBase
cd SimulationRuntime/OMSI; \
$(foreach PLATFORM, $(PLATFORMS), \
(cd Build_$(PLATFORM); $(MAKE) install);) \
test ! `uname` = Darwin || install_name_tool -id @rpath/omsi/libOMSIBase.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsi/libOMSIBase.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/omsi/libOMSISolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsi/libOMSISolver.dylib
OMSIBaseClean:
cd SimulationRuntime/OMSI; \
$(foreach PLATFORM, $(PLATFORMS), \
test -d Build_$(PLATFORM) && cd Build_$(PLATFORM) && $(MAKE) uninstall && $(MAKE) DESTDIR=$(OMBUILDDIR) clean && cd ..; \
rm -R -f Build_$(PLATFORM); \
)
#############################
# Rules for OMSIC libraries
#############################
OMSIC: OMSIBaseInstall
cd SimulationRuntime/OMSIC; \
$(foreach PLATFORM, $(PLATFORMS), \
mkdir -p Build_$(PLATFORM); \
(cd ./Build_$(PLATFORM); echo "change to Build_$(PLATFORM)"; \
$(CMAKE_CALL); \
$(MAKE) ); )
OMSICInstall: OMSIC
cd SimulationRuntime/OMSIC; \
$(foreach PLATFORM, $(PLATFORMS), \
(cd Build_$(PLATFORM); $(MAKE) install);)
OMSICClean:
cd SimulationRuntime/OMSIC; \
$(foreach PLATFORM, $(PLATFORMS), \
test -d Build_$(PLATFORM) && cd Build_$(PLATFORM) && $(MAKE) uninstall && $(MAKE) DESTDIR=$(OMBUILDDIR) clean && cd ..; \
rm -R -f Build_$(PLATFORM); \
)