-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmake.mk
executable file
·62 lines (47 loc) · 1.59 KB
/
cmake.mk
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
DIR_INS=${HOME}/local/
DIR_BIN=${DIR_INS}bin/
DIR_LIB=${DIR_INS}lib/
CMAKE=cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=${DIR_INS}
CMAKE_RLS=$(CMAKE) -DCMAKE_BUILD_TYPE=Release
CMAKE_DBG=$(CMAKE) -DCMAKE_BUILD_TYPE=Debug
NINJA=ninja
MKDIR=mkdir -p
MKDIR_BUILD=$(MKDIR) build && cd build
default: release
debugrun: debug
build/src/$(BIN)
run: release
${DIR_BIN}$(BIN)
run_intel: release_intel
${DIR_BIN}$(BIN)
.PHONY: test
test:
export FC=caf && \
$(MKDIR_BUILD) && $(CMAKE_DBG) && $(NINJA) && ctest -VV
.PHONY: test_intel
test_intel:
source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh -arch intel64 -platform linux && \
export FC=ifort CC=icc CXX=icpc && \
$(MKDIR_BUILD) && $(CMAKE_DBG) && $(NINJA) && ctest -VV
.PHONY: debug
debug:
export FC=caf && \
$(MKDIR_BUILD) && $(CMAKE_DBG) && $(NINJA) && $(NINJA) install
.PHONY: debug_intel
debug_intel:
source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh -arch intel64 -platform linux && \
export FC=ifort CC=icc CXX=icpc && \
$(MKDIR_BUILD) && $(CMAKE_DBG) && $(NINJA) && $(NINJA) install
.PHONY: release
release:
export FC=caf && \
$(MKDIR_BUILD) && $(CMAKE_RLS) && $(NINJA) && $(NINJA) install
.PHONY: release_intel
release_intel:
source /opt/intel/compilers_and_libraries/linux/bin/compilervars.sh -arch intel64 -platform linux && \
export FC=ifort CC=icc CXX=icpc && \
$(MKDIR_BUILD) && $(CMAKE_RLS) && $(NINJA) && $(NINJA) install
clean:
rm -r build ${HOME}/local/bin/${BIN} ${HOME}/local/debug/${BIN}
clean_lib:
rm -r build ${HOME}/local/lib/${LIB}