-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
96 lines (83 loc) · 2.1 KB
/
Makefile
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
# Configuration options.
gdb = not-set
assert = not-set
assert2 = not-set
debug = not-set
gprof = not-set
openmp = yes
prefix = not-set
gklib_path = not-set
bcls_path = not-set
shared = not-set
with_mkl = not-set
cc = not-set
cxx = not-set
#cc = /usr/bin/gcc
#cxx = /usr/bin/g++
#===============================================================
# There should be no need to modify beyond this point
cputype = $(shell uname -m | sed "s/\\ /_/g")
systype = $(shell uname -s)
BUILDDIR = build/$(systype)-$(cputype)
# Process configuration options.
CONFIG_FLAGS = -DCMAKE_VERBOSE_MAKEFILE=1
ifeq ($(gklib_path), not-set)
gklib_path = GKlib
endif
#CONFIG_FLAGS += -DGKLIB_PATH=$(abspath $(gklib_path))
ifneq ($(gdb), not-set)
CONFIG_FLAGS += -DGDB=$(gdb)
endif
ifneq ($(assert), not-set)
CONFIG_FLAGS += -DASSERT=$(assert)
endif
ifneq ($(assert2), not-set)
CONFIG_FLAGS += -DASSERT2=$(assert2)
endif
ifneq ($(debug), not-set)
CONFIG_FLAGS += -DDEBUG=$(debug)
endif
ifneq ($(gprof), not-set)
CONFIG_FLAGS += -DGPROF=$(gprof)
endif
ifneq ($(openmp), not-set)
CONFIG_FLAGS += -DOPENMP=$(openmp)
endif
ifneq ($(prefix), not-set)
CONFIG_FLAGS += -DCMAKE_INSTALL_PREFIX=$(prefix)
endif
ifneq ($(shared), not-set)
CONFIG_FLAGS += -DSHARED=1
endif
ifneq ($(with_mkl), not-set)
CONFIG_FLAGS += -DWITH_MKL=1
endif
ifneq ($(cc), not-set)
CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc)
endif
ifneq ($(cxx), not-set)
CONFIG_FLAGS += -DCMAKE_CXX_COMPILER=$(cxx)
endif
VERNUM=1.0.1
PKGNAME=slim-$(VERNUM)
define run-config
mkdir -p $(BUILDDIR)
cd $(BUILDDIR) && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 $(CURDIR) $(CONFIG_FLAGS)
endef
all clean install:
@if [ ! -f $(BUILDDIR)/Makefile ]; then \
more BUILD.txt; \
else \
make -C $(BUILDDIR) $@ $(MAKEFLAGS); \
fi
uninstall:
xargs rm < $(BUILDDIR)/install_manifest.txt
config: distclean
$(run-config)
distclean:
rm -rf $(BUILDDIR)
remake:
find . -name CMakeLists.txt -exec touch {} ';'
dist:
utils/mkdist.sh $(PKGNAME)
.PHONY: config distclean all clean install uninstall remake dist