-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (35 loc) · 988 Bytes
/
Makefile
File metadata and controls
48 lines (35 loc) · 988 Bytes
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
# Makefile -- Use this to build on *NIX systems.
# Options set on command line.
verbose = not-set
polymec = not-set
# This proxies everything to the builddir cmake.
cputype = $(shell uname -m | sed "s/\\ /_/g")
systype = $(shell uname -s)
BUILDDIR := build/$(systype)-$(cputype)
# Process configuration options.
# Verbose builds?
ifeq ($(verbose), 1)
CONFIG_FLAGS += -DCMAKE_VERBOSE_MAKEFILE=1
endif
BUILDDIR := ${BUILDDIR}-`basename ${CC}`
# Location of polymec library.
ifneq ($(polymec), not-set)
CONFIG_FLAGS += -DPOLYMEC_PREFIX:PATH=$(polymec)
else
CONFIG_FLAGS += -DPOLYMEC_PREFIX:PATH=/usr/local
endif
define run-config
@mkdir -p $(BUILDDIR)
@cd $(BUILDDIR) && cmake $(CURDIR) $(CONFIG_FLAGS)
endef
all test clean install:
@if [ ! -f $(BUILDDIR)/Makefile ]; then \
more INSTALL; \
else \
make -C $(BUILDDIR) $@ $(MAKEFLAGS); \
fi
config: distclean
$(run-config)
distclean:
@rm -rf $(BUILDDIR)
.PHONY: config distclean all clean install uninstall