-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
49 lines (38 loc) · 1.33 KB
/
makefile
File metadata and controls
49 lines (38 loc) · 1.33 KB
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
SHELL = /bin/sh
# project name (generate executable with this name)
PRIMARY_PROJECT_FOLDER = testJSON
PRIMARY_PROGRAM = testJSON
# Dependencies
# Boost
BOOST_VER=_1_66_0
BOOST_LIBS_TO_BUILD = filesystem timer chrono system
#relative to this file
BOOST_LIB_DIR = shared/lib_boost$(BOOST_VER)
#relative to this file
BOOSTDIR = shared/boost$(BOOST_VER)
#Subdirectories
DIRECTORIES = $(sort $(dir $(wildcard */makefile)))
.PHONY: build
build: dependencies
@$(foreach dir,$(DIRECTORIES),$(MAKE) -C $(dir);)
dependencies:
@echo "---- Build Dependencies ----"
@$(MAKE) -C shared -f build_boost_libs.mk BOOST_LIBS_TO_BUILD="$(BOOST_LIBS_TO_BUILD)" BOOST_LIB_DIR="../$(BOOST_LIB_DIR)" BOOSTDIR="../$(BOOSTDIR)" BOOST_VER="$(BOOST_VER)"
.PHONY: rebuild
rebuild: remove
@echo "---- Remove Output Binary ----"
@$(foreach dir,$(DIRECTORIES),$(MAKE) -C $(dir) remove;)
.PHONY: clean
clean:
@echo "---- Cleaning ----"
@$(foreach dir,$(DIRECTORIES),$(MAKE) -C $(dir) clean;)
clean-dependencies:
@echo "---- Clean Dependencies ----"
@$(MAKE) -C shared -f build_boost_libs.mk BOOST_LIB_DIR="../$(BOOST_LIB_DIR)" clean
.PHONY: remove
remove: clean
@echo "---- Removing ----"
@$(foreach dir,$(DIRECTORIES),$(MAKE) -C $(dir) remove;)
run: build
@echo "---- Running "$(PRIMARY_PROGRAM)"----"
@./$(PRIMARY_PROJECT_FOLDER)/out/$(PRIMARY_PROGRAM)