-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
44 lines (35 loc) · 1.02 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
CXX ?= g++
CC ?= gcc
CMAKE = cmake
TOP = $(shell pwd)
MAKE := $(MAKE) --no-print-directory
CMAKE_FLAGS =
#OPROFILE = 1
#ifeq ($(shell which distcc > /dev/null; echo $$?), 0)
# CXX := distcc $(CXX)
# CC := distcc $(CC)
# PARALLELISM := $(shell distcc -j)
#else
PARALLELISM = 2
#endif
export CXX CC CFLAGS CPPFLAGS OPROFILE
all: debug
release:
@mkdir -p bin/release
@cd bin/release && $(CMAKE) $(CMAKE_FLAGS) -DCMAKE_BUILD_TYPE=Release $(TOP)/src
@cd bin/release && $(MAKE) -j${PARALLELISM}
debug:
@mkdir -p bin/debug
@cd bin/debug && $(CMAKE) $(CMAKE_FLAGS) -DCMAKE_BUILD_TYPE=Debug $(TOP)/src
@cd bin/debug && $(MAKE) -j${PARALLELISM}
eclipse:
#CMAKE_FLAGS = -G"Eclipse CDT4 - Unix Makefiles"
@make debug CMAKE_FLAGS=-G"Eclipse CDT4 - Unix Makefiles"
#$(MAKE) release CMAKE_FLAGS = -G"Eclipse CDT4 - Unix Makefiles"
docs:
@cd docs/ && $(MAKE)
clean:
rm -rf bin/*
.DEFAULT: bin/debug/Makefile bin/release/Makefile
@cd bin/release && $(MAKE) $@
@cd bin/debug && $(MAKE) $@