forked from joestringer/RouteFlow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
89 lines (73 loc) · 1.95 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
80
81
82
83
84
85
86
87
88
89
export ROOT_DIR=$(CURDIR)
export BUILD_DIR=$(ROOT_DIR)/build
export LIB_DIR=$(ROOT_DIR)/rflib
export RFC_DIR=$(ROOT_DIR)/nox
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 openflow
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 $(RFC_DIR); \
./boot.sh; \
mkdir build; \
cd build; \
export CPP=; \
../configure --enable-ndebug; \
make -C $(RFC_DIR)/build; \
echo "done."
clean: clean-libs clean-apps_obj clean-apps_bin clean-nox
clean-nox:
@rm -rf $(RFC_DIR)/build
@rm -rf $(RFC_DIR)/autom4te.cache
@rm -f $(RFC_DIR)/aclocal.m4
@rm -f $(RFC_DIR)/config.h*
@rm -f $(RFC_DIR)/configure.ac
@rm -f $(RFC_DIR)/configure
@rm -f $(RFC_DIR)/Makefile.in
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