-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (46 loc) · 2.44 KB
/
Copy pathMakefile
File metadata and controls
53 lines (46 loc) · 2.44 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
50
51
52
53
.PHONY: all clean cleanall makefiles checkenvir tests
all: makefiles
@cd src && $(MAKE)
tests: all
@cd tests/fingerprint && ./fingerprints
clean: makefiles
@cd src && $(MAKE) clean
cleanall: makefiles
@cd src && $(MAKE) MODE=release clean
@cd src && $(MAKE) MODE=debug clean
@rm -f src/Makefile
# nascTime imports both INET and Simu5G. Their locations come from the
# INET_ROOT / SIMU5G_ROOT environment variables (exported by sourcing each
# project's own 'setenv'), exactly as Simu5G consumes INET_ROOT. There is no
# hardcoded sibling-directory default; override on the command line if needed:
# make INET_ROOT=/path/to/inet SIMU5G_ROOT=/path/to/simu5g
checkenvir:
@if [ -z "$(INET_ROOT)" ] || [ ! -d "$(INET_ROOT)/src" ]; then \
echo; \
echo '======================================================================='; \
echo 'INET_ROOT is not set, or does not point to an INET tree.'; \
echo 'Source INET'\''s setenv before building, or pass INET_ROOT=<path>.'; \
echo '======================================================================='; \
echo; \
exit 1; \
fi
@if [ -z "$(SIMU5G_ROOT)" ] || [ ! -d "$(SIMU5G_ROOT)/src" ]; then \
echo; \
echo '======================================================================='; \
echo 'SIMU5G_ROOT is not set, or does not point to a Simu5G tree.'; \
echo 'Source Simu5G'\''s setenv before building, or pass SIMU5G_ROOT=<path>.'; \
echo '======================================================================='; \
echo; \
exit 1; \
fi
# Extract the makemake options from .oppbuildspec so the command-line build and
# the IDE build stay in sync (single source of truth). The IDE writes --meta:xxx
# options that opp_makemake does not accept on the command line, so translate
# --meta:export-include-path to -I. , add -f before --deep, and drop the rest.
MAKEMAKE_OPTIONS := $(shell sed -n 's/.*makemake-options\s*=\s*"\([^"]*\)".*/\1/p' .oppbuildspec | sed 's/--meta:export-include-path/-I./g' | sed 's/--deep/-f --deep/g' | sed 's/ --meta:[^ ]*//g')
# Add the options that pull in the INET and Simu5G dependencies.
MAKEMAKE_OPTIONS := $(MAKEMAKE_OPTIONS) -KINET_PROJ=$(INET_ROOT) -KSIMU5G_PROJ=$(SIMU5G_ROOT) -DINET_IMPORT -DSIMU5G_IMPORT -I. -I$$\(INET_PROJ\)/src -I$$\(SIMU5G_PROJ\)/src -L$$\(INET_PROJ\)/src -L$$\(SIMU5G_PROJ\)/src -lINET$$\(D\) -lsimu5g$$\(D\)
makefiles: checkenvir
@$(info *** CREATING Makefile with:)
@$(info opp_makemake $(MAKEMAKE_OPTIONS))
@cd src && opp_makemake $(MAKEMAKE_OPTIONS)