1 | # Configuration options.
|
---|
2 | gdb = not-set
|
---|
3 | assert = not-set
|
---|
4 | assert2 = not-set
|
---|
5 | debug = not-set
|
---|
6 | openmp = not-set
|
---|
7 | prefix = not-set
|
---|
8 | gklib_path = not-set
|
---|
9 | metis_path = not-set
|
---|
10 | msmpi_root = not-set
|
---|
11 | shared = not-set
|
---|
12 | cc = mpicc
|
---|
13 | cxx = mpicxx
|
---|
14 | ar = not-set
|
---|
15 | gcc-ar = not-set
|
---|
16 | ranlib = not-set
|
---|
17 | gcc-ranlib = not-set
|
---|
18 | linker = not-set
|
---|
19 | nm = not-set
|
---|
20 | objcopy = not-set
|
---|
21 | objdump = not-set
|
---|
22 | rc = not-set
|
---|
23 | strip = not-set
|
---|
24 |
|
---|
25 |
|
---|
26 | # Basically proxies everything to the builddir cmake.
|
---|
27 |
|
---|
28 | PKGNAME = parmetis-4.0.3
|
---|
29 |
|
---|
30 | cputype = $(shell uname -m | sed "s/\\ /_/g")
|
---|
31 | systype = $(shell uname -s)
|
---|
32 |
|
---|
33 | BUILDDIR = build/$(systype)-$(cputype)
|
---|
34 |
|
---|
35 | # Process configuration options.
|
---|
36 | CONFIG_FLAGS = -DCMAKE_VERBOSE_MAKEFILE=1
|
---|
37 | ifeq ($(gklib_path), not-set)
|
---|
38 | gklib_path = metis/GKlib
|
---|
39 | endif
|
---|
40 | ifeq ($(metis_path), not-set)
|
---|
41 | metis_path = metis
|
---|
42 | endif
|
---|
43 | CONFIG_FLAGS += -DGKLIB_PATH=$(abspath $(gklib_path)) -DMETIS_PATH=$(abspath $(metis_path))
|
---|
44 | ifneq ($(local_msmpi), not-set)
|
---|
45 | CONFIG_FLAGS += -DLOCAL_MSMPI=1 -DMSMPI_ROOT=$(abspath $(msmpi_root))
|
---|
46 | endif
|
---|
47 | ifneq ($(gdb), not-set)
|
---|
48 | CONFIG_FLAGS += -DGDB=$(gdb)
|
---|
49 | endif
|
---|
50 | ifneq ($(assert), not-set)
|
---|
51 | CONFIG_FLAGS += -DASSERT=$(assert)
|
---|
52 | endif
|
---|
53 | ifneq ($(assert2), not-set)
|
---|
54 | CONFIG_FLAGS += -DASSERT2=$(assert2)
|
---|
55 | endif
|
---|
56 | ifneq ($(debug), not-set)
|
---|
57 | CONFIG_FLAGS += -DDEBUG=$(debug)
|
---|
58 | endif
|
---|
59 | ifneq ($(openmp), not-set)
|
---|
60 | CONFIG_FLAGS += -DOPENMP=$(openmp)
|
---|
61 | endif
|
---|
62 | ifneq ($(prefix), not-set)
|
---|
63 | CONFIG_FLAGS += -DCMAKE_INSTALL_PREFIX=$(prefix)
|
---|
64 | endif
|
---|
65 | ifneq ($(shared), not-set)
|
---|
66 | CONFIG_FLAGS += -DSHARED=1
|
---|
67 | endif
|
---|
68 | ifneq ($(cc), not-set)
|
---|
69 | CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc)
|
---|
70 | endif
|
---|
71 | ifneq ($(cxx), not-set)
|
---|
72 | CONFIG_FLAGS += -DCMAKE_CXX_COMPILER=$(cxx)
|
---|
73 | endif
|
---|
74 | ifneq ($(ar), not-set)
|
---|
75 | CONFIG_FLAGS += -DCMAKE_AR=$(ar)
|
---|
76 | endif
|
---|
77 | ifneq ($(gcc-ar), not-set)
|
---|
78 | CONFIG_FLAGS += -DCMAKE_C_COMPILER_AR=$(gcc-ar) -DCMAKE_CXX_COMPILER_AR=$(gcc-ar)
|
---|
79 | endif
|
---|
80 | ifneq ($(ranlib), not-set)
|
---|
81 | CONFIG_FLAGS += -DCMAKE_RANLIB=$(ranlib)
|
---|
82 | endif
|
---|
83 | ifneq ($(gcc-ranlib), not-set)
|
---|
84 | CONFIG_FLAGS += -DCMAKE_C_COMPILER_RANLIB=$(gcc-ranlib) -DCMAKE_CXX_COMPILER_RANLIB=$(gcc-ranlib)
|
---|
85 | endif
|
---|
86 | ifneq ($(linker), not-set)
|
---|
87 | CONFIG_FLAGS += -DCMAKE_LINKER=$(linker)
|
---|
88 | endif
|
---|
89 | ifneq ($(nm), not-set)
|
---|
90 | CONFIG_FLAGS += -DCMAKE_NM=$(nm)
|
---|
91 | endif
|
---|
92 | ifneq ($(objcopy), not-set)
|
---|
93 | CONFIG_FLAGS += -DCMAKE_OBJCOPY=$(objcopy)
|
---|
94 | endif
|
---|
95 | ifneq ($(objdump), not-set)
|
---|
96 | CONFIG_FLAGS += -DCMAKE_OBJDUMP=$(objdump)
|
---|
97 | endif
|
---|
98 | ifneq ($(rc), not-set)
|
---|
99 | CONFIG_FLAGS += -DCMAKE_RC_COMPILER=$(rc)
|
---|
100 | endif
|
---|
101 | ifneq ($(strip), not-set)
|
---|
102 | CONFIG_FLAGS += -DCMAKE_STRIP=$(strip)
|
---|
103 | endif
|
---|
104 |
|
---|
105 | define run-config
|
---|
106 | mkdir -p $(BUILDDIR)
|
---|
107 | cd $(BUILDDIR) && cmake $(CURDIR) $(CONFIG_FLAGS)
|
---|
108 | endef
|
---|
109 |
|
---|
110 | all clean install:
|
---|
111 | @if [ ! -f $(BUILDDIR)/Makefile ]; then \
|
---|
112 | more BUILD.txt; \
|
---|
113 | else \
|
---|
114 | make -C $(BUILDDIR) $@ $(MAKEFLAGS); \
|
---|
115 | fi
|
---|
116 |
|
---|
117 | uninstall:
|
---|
118 | xargs rm < $(BUILDDIR)/install_manifest.txt
|
---|
119 |
|
---|
120 | config: distclean
|
---|
121 | $(run-config)
|
---|
122 |
|
---|
123 | distclean:
|
---|
124 | rm -rf $(BUILDDIR)
|
---|
125 |
|
---|
126 | remake:
|
---|
127 | find . -name CMakeLists.txt -exec touch {} ';'
|
---|
128 |
|
---|
129 | dist:
|
---|
130 | util/mkdist.sh $(PKGNAME)
|
---|
131 |
|
---|
132 |
|
---|
133 | .PHONY: config distclean dist all clean install uninstall remake
|
---|