-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
executable file
·74 lines (65 loc) · 1.92 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
#.SILENT:
ifneq ($(WINDIR),)
ARCH=WIN32
GBUILDSTR=WIN32-i686-vc10
ifeq ($(shell uname -o), Cygwin)
WINCURDIR = $(shell cygpath -wm $(CURDIR))
else
WINCURDIR = $(CURDIR)
endif
else
UNAME=$(shell uname)
ifeq ($(UNAME), Linux)
ARCH=linux
NPROCS = $(shell nproc)
else ifeq ($(UNAME), Darwin)
ARCH=OSX
else
$(error The Makefile does not recognize the architecture: $(UNAME))
endif
endif
all: gen
gen:
mkdir -p ./build
ifeq ($(ARCH), linux)
mkdir -p ./build/Release
mkdir -p ./build/Debug
cd ./build/Release; cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(CURDIR)/install ../../
cd ./build/Debug; cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$(CURDIR)/install ../../
else ifeq ($(ARCH), WIN32)
cd ./build; cmake -DGBUILDSTR=$(GBUILDSTR) -DCMAKE_INSTALL_PREFIX=$(WINCURDIR)/install ../ -G "Visual Studio 10 Win64"
else ifeq ($(ARCH), OSX)
cd ./build; cmake -DCMAKE_INSTALL_PREFIX=$(CURDIR)/install ../ -G Xcode
endif
debug:
ifeq ($(ARCH), linux)
cd ./build/$(GBUILDSTR)/Debug; make -j$(NPROC)
else
@echo "Open the project file to build the project on this architecture."
endif
release opt:
ifeq ($(ARCH), linux)
cd ./build/$(GBUILDSTR)/Release; make -j$(NPROC)
else
@echo "Open the project file to build the project on this architecture."
endif
install:
ifeq ($(ARCH), linux)
cd ./build/$(GBUILDSTR)/Debug; make install
cd ./build/$(GBUILDSTR)/Release; make install
else
@echo "Open the project file to run make install on this architecture."
endif
clean:
ifeq ($(ARCH), linux)
cd ./build/$(GBUILDSTR)/Debug; make clean
cd ./build/$(GBUILDSTR)/Release; make clean
else
@echo "Open the project file to run make clean on this architecture."
endif
clobber:
rm -rf ./build
rm -rf ./dependencies/boost
rm -rf ./dependencies/glfw
rm -rf ./dependencies/vrpn
rm -rf ./install