-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
77 lines (64 loc) · 2.47 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
#Try to detect INET if variable is not set
ifndef INET_PROJ
ifneq ($(wildcard ../inet),)
INET_PROJ=../../inet
else
$(error "Cannot find INET framework in the usual location. You have to set the PATH to INET in the INET_PROJ variable")
endif
endif
#Try to detect CoRE4INET if variable is not set
ifndef CORE4INET_PROJ
ifneq ($(wildcard ../CoRE4INET),)
CORE4INET_PROJ=../../CoRE4INET
else
$(error "Cannot find CoRE4INET framework in the usual location. You have to set the PATH to INET in the INET_PROJ variable")
endif
endif
#Try to detect OpenFlow if variable is not set
ifndef OPENFLOW_PROJ
ifneq ($(wildcard ../OpenFlow),)
OPENFLOW_PROJ=../../OpenFlow
else
$(error "Cannot find OpenFlow framework in the usual location. You have to set the PATH to OpenFlow in the OPENFLOW_PROJ variable")
endif
endif
#Try to detect SOA4CoRE if variable is not set
ifndef SOA4CORE_PROJ
ifneq ($(wildcard ../SOA4CoRE),)
SOA4CORE_PROJ=../../SOA4CoRE
else
$(error "Cannot find SOA4CoRE framework in the usual location. You have to set the PATH to SOA4CoRE in the SOA4CoRE_PROJ variable")
endif
endif
all: checkmakefiles
cd src && $(MAKE)
clean: checkmakefiles
cd src && $(MAKE) clean
cleanall: checkmakefiles
cd src && $(MAKE) MODE=release clean
cd src && $(MAKE) MODE=debug clean
rm -f src/Makefile
ifeq ($(MODE), debug)
DBG_SUFFIX=_dbg
else
DBG_SUFFIX=
endif
MAKEMAKE_OPTIONS := -f --deep --no-deep-includes -O out -KINET_PROJ=$(INET_PROJ) -KCORE4INET_PROJ=$(CORE4INET_PROJ) -KOPENFLOW_PROJ=$(OPENFLOW_PROJ) -KSOA4CORE_PROJ=$(SOA4CORE_PROJ) -I. -I$(INET_PROJ)/src/ -I$(CORE4INET_PROJ)/src/ -I$(OPENFLOW_PROJ)/src/ -I$(SOA4CORE_PROJ)/src/ -L$(INET_PROJ)/src -L$(CORE4INET_PROJ)/src -L$(OPENFLOW_PROJ)/src -L$(SOA4CORE_PROJ)/src -lCoRE4INET$(DBG_SUFFIX) -lINET$(DBG_SUFFIX) -lOpenFlow$(DBG_SUFFIX) -lSOA4CoRE$(DBG_SUFFIX)
makefiles: makefiles-so
makefiles-so:
@cd src && opp_makemake --make-so $(MAKEMAKE_OPTIONS)
makefiles-lib:
@cd src && opp_makemake --make-lib $(MAKEMAKE_OPTIONS)
makefiles-exe:
@cd src && opp_makemake $(MAKEMAKE_OPTIONS)
checkmakefiles:
@if [ ! -f src/Makefile ]; then \
echo; \
echo '======================================================================='; \
echo 'src/Makefile does not exist. Please use "make makefiles" to generate it!'; \
echo '======================================================================='; \
echo; \
exit 1; \
fi
doxy:
doxygen doxy.cfg