forked from routeflow/RouteFlow
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
79 lines (63 loc) · 1.7 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
75
76
77
78
79
export ROOT_DIR=$(CURDIR)
export BUILD_DIR=$(ROOT_DIR)/build
export LIB_DIR=$(ROOT_DIR)/rflib
export NOX_DIR=$(ROOT_DIR)/nox-rfproxy
export MONGO_DIR=/usr/local/include/mongo
export BUILD_LIB_DIR=$(BUILD_DIR)/lib
export BUILD_OBJ_DIR=$(BUILD_DIR)/obj
export RFLIB_NAME=rflib
#the lib subdirs should be done first
export libdirs := ipc types
export srcdirs := rfclient
export CPP := g++
export CFLAGS := -Wall -W
export AR := ar
all: build lib app #nox
build:
@mkdir -p $(BUILD_DIR);
lib: build
@mkdir -p $(BUILD_OBJ_DIR);
@mkdir -p $(BUILD_LIB_DIR);
@for dir in $(libdirs); do \
mkdir -p $(BUILD_OBJ_DIR)/$$dir; \
echo "Compiling Library Dependency ($$dir)..."; \
make -C $(LIB_DIR)/$$dir all || exit 1; \
echo "done."; \
done
@echo "Generating Library";
make -C $(LIB_DIR) all;
app: lib
@mkdir -p $(BUILD_OBJ_DIR);
@for dir in $(srcdirs); do \
mkdir -p $(BUILD_OBJ_DIR)/$$dir; \
echo "Compiling Application $$dir..."; \
make -C $(ROOT_DIR)/$$dir all || exit 1; \
echo "done."; \
done
rfclient: lib
@mkdir -p $(BUILD_OBJ_DIR);
@for dir in "rfclient" ; do \
mkdir -p $(BUILD_OBJ_DIR)/$$dir; \
echo "Compiling Application $$dir..."; \
make -C $(ROOT_DIR)/$$dir all || exit 1; \
echo "done."; \
done
nox: lib
echo "Building NOX with rfproxy..."
cd $(NOX_DIR); \
export CPP=; \
make -C $(BUILD_DIR)/nox; \
echo "done."
clean: clean-libs clean-apps_obj clean-apps_bin #clean-nox
clean-nox:
@rm -rf $(BUILD_DIR)/nox
clean-libs:
@rm -rf $(BUILD_LIB_DIR)
@for dir in $(libdirs); do \
rm -rf $(BUILD_OBJ_DIR)/$$dir; \
done
clean-apps_obj:
@rm -rf $(BUILD_OBJ_DIR)
clean-apps_bin:
@rm -rf $(BUILD_DIR)
.PHONY:all lib app nox clean clean-nox clean-libs clean-apps_obj clean-apps_bin