forked from nasa/nos3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (69 loc) · 1.75 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
#
# Top Level Mission Makefile
#
BUILDTYPE ?= debug
INSTALLPREFIX ?= exe
FSWBUILDDIR ?= $(CURDIR)/fsw/build
SIMBUILDDIR ?= $(CURDIR)/sims/build
export CFS_APP_PATH = components
# The "prep" step requires extra options that are specified via enviroment variables.
# Certain special ones should be passed via cache (-D) options to CMake.
# These are only needed for the "prep" target but they are computed globally anyway.
PREP_OPTS :=
ifneq ($(INSTALLPREFIX),)
PREP_OPTS += -DCMAKE_INSTALL_PREFIX=$(INSTALLPREFIX)
endif
ifneq ($(VERBOSE),)
PREP_OPTS += --trace
endif
ifneq ($(BUILDTYPE),)
PREP_OPTS += -DCMAKE_BUILD_TYPE=$(BUILDTYPE)
endif
# The "LOCALTGTS" defines the top-level targets that are implemented in this makefile
# Any other target may also be given, in that case it will simply be passed through.
LOCALTGTS := all fsw fsw-prep sim sim-prep clean clean-fsw clean-sim launch stop
OTHERTGTS := $(filter-out $(LOCALTGTS),$(MAKECMDGOALS))
# As this makefile does not build any real files, treat everything as a PHONY target
# This ensures that the rule gets executed even if a file by that name does exist
.PHONY: $(LOCALTGTS) $(OTHERTGTS)
#
# Generic Commands
#
all:
$(MAKE) fsw
$(MAKE) sim
#
# FSW
#
fsw:
$(MAKE) fsw-prep
$(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install
fsw-prep:
mkdir -p $(FSWBUILDDIR)
cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) ../cfe
#
# Sims
#
sim:
$(MAKE) sim-prep
$(MAKE) --no-print-directory -C $(SIMBUILDDIR) install
sim-prep:
mkdir -p $(SIMBUILDDIR)
cd $(SIMBUILDDIR) && cmake -DCMAKE_INSTALL_PREFIX=$(SIMBUILDDIR) ..
#
# Clean
#
clean:
$(MAKE) clean-fsw
$(MAKE) clean-sim
clean-fsw:
rm -rf fsw/build
clean-sim:
rm -rf sims/build
#
# Script Calls
#
launch:
./gsw/scripts/launch.sh
stop:
./gsw/scripts/stop.sh