-
Notifications
You must be signed in to change notification settings - Fork 133
/
Makefile
63 lines (49 loc) · 1.45 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
#!/usr/bin/env make
SH ?= sh
uname_S := $(shell $(SH) -c 'uname -s || echo kernel')
uname_R := $(shell $(SH) -c 'uname -r | cut -d- -f1 || echo release')
uname_M := $(shell $(SH) -c 'uname -m || echo machine')
lib ?= lib64
FLAVOR ?= optimize
platformdir ?= $(uname_S)-$(uname_R)-$(uname_M)-$(FLAVOR)
builddir ?= $(CURDIR)/build/$(platformdir)
prefix ?= $(CURDIR)/$(platformdir)
#DESTDIR =
CMAKE_FLAGS =
# Allow out-of-band customization
-include Makefile.config
ifdef V
VERBOSE=1
export VERBOSE
endif
# Installation location: prefix=<path>
CMAKE_FLAGS += -DCMAKE_INSTALL_PREFIX=$(prefix)
# gtest location: RP_gtest=<path>
ifdef RP_gtest
CMAKE_FLAGS += -DGTEST_LOCATION=$(RP_gtest)
CMAKE_FLAGS += -DPARTIO_GTEST_ENABLED=1
endif
# Extra cmake flags: CMAKE_EXTRA_FLAGS=<flags>
ifdef CMAKE_EXTRA_FLAGS
CMAKE_FLAGS += $(CMAKE_EXTRA_FLAGS)
endif
ifdef RP_zlib
CMAKE_FLAGS += -DZLIB_INCLUDE_DIR=$(RP_zlib)/include
CMAKE_FLAGS += -DZLIB_LIBRARY_RELEASE=$(RP_zlib)/$(lib)/libz.so
endif
# The default target in this Makefile is...
all::
install: all
$(MAKE) -C $(builddir) DESTDIR=$(DESTDIR) install
test: all
$(MAKE) -C $(builddir) DESTDIR=$(DESTDIR) test
doc: $(builddir)/stamp
$(MAKE) -C $(builddir) DESTDIR=$(DESTDIR) doc
$(builddir)/stamp:
mkdir -p $(builddir)
cd $(builddir) && cmake $(CMAKE_FLAGS) ../..
touch $@
all:: $(builddir)/stamp
$(MAKE) -C $(builddir) $(MAKEARGS) all
clean: $(builddir)/stamp
$(MAKE) -C $(builddir) $(MAKEARGS) clean