-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinuxBuildStructureMakefile
62 lines (52 loc) · 1.85 KB
/
LinuxBuildStructureMakefile
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
RELEASE_DIR=@RELEASE_DIR@
DEBUG_DIR=@DEBUG_DIR@
COLOR_BUILD=@COLOR_BUILD@
COLOR_SUCCEED=@COLOR_SUCCEED@
COLOR_FAILED=@COLOR_FAILED@
COLOR_RESET=@COLOR_RESET@
all: release debug
.PHONY : all
.NOTPARALLEL : all
release:
@( \
cd ${RELEASE_DIR} \
&& echo -e "\n${COLOR_BUILD}##### Building RELEASE #####${COLOR_RESET}" \
&& $(MAKE) \
&& echo -e "${COLOR_SUCCEED}##### Successfully built RELEASE #####${COLOR_RESET}" \
) || ( echo -e "${COLOR_FAILED}##### Failed building RELEASE #####${COLOR_RESET}" && exit 1 )
.PHONY : release
debug:
@( \
cd ${DEBUG_DIR} \
&& echo -e "\n${COLOR_BUILD}##### Building DEBUG #####${COLOR_RESET}" \
&& $(MAKE) \
&& echo -e "${COLOR_SUCCEED}##### Successfully built DEBUG #####${COLOR_RESET}" \
) || ( echo -e "${COLOR_FAILED}##### Failed building DEBUG #####${COLOR_RESET}" && exit 1 )
.PHONY : debug
clean:
@( \
cd ${RELEASE_DIR} \
&& echo -e "\n${COLOR_BUILD}##### Cleaning RELEASE #####${COLOR_RESET}" \
&& $(MAKE) clean \
) || exit 1
@( \
cd ${DEBUG_DIR} \
&& echo -e "\n${COLOR_BUILD}##### Cleaning DEBUG #####${COLOR_RESET}" \
&& $(MAKE) clean \
) || exit 1
.PHONY : clean
# maps any non-specified call to the subdirs, to allow building specific targets
.DEFAULT default:
( \
cd ${RELEASE_DIR} \
&& echo -e "\n${COLOR_BUILD}##### Building RELEASE #####${COLOR_RESET}" \
&& $(MAKE) $@ \
&& echo -e "${COLOR_SUCCEED}##### Successfully built RELEASE #####${COLOR_RESET}" \
) || ( echo -e "${COLOR_FAILED}##### Failed building RELEASE #####${COLOR_RESET}" && exit 1 )
( \
cd ${DEBUG_DIR} \
&& echo -e "\n${COLOR_BUILD}##### Building DEBUG #####${COLOR_RESET}" \
&& $(MAKE) $@ \
&& echo -e "${COLOR_SUCCEED}##### Successfully built DEBUG #####${COLOR_RESET}" \
) || ( echo -e "${COLOR_FAILED}##### Failed building DEBUG #####${COLOR_RESET}" && exit 1 )
NOTPARALLEL : default