-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
120 lines (94 loc) · 2.2 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#
# 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 pack sim sim-prep clean clean-fsw clean-sim checkout gsw gsm-prep launch log real-clean stop sc-launch
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
$(MAKE) gsw
#
# 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) ..
#
# GSW
#
gsw:
$(MAKE) gsw-prep
./gsw/scripts/create_cosmos_gem.sh
gsw-prep:
mkdir -p ./gsw/cosmos/build
#
# Clean
#
clean:
$(MAKE) clean-fsw
$(MAKE) clean-sim
$(MAKE) clean-gsw
clean-fsw:
rm -rf fsw/build
clean-sim:
rm -rf sims/build
clean-gsw:
rm -rf gsw/cosmos/build
#
# Script Calls
#
checkout:
./gsw/scripts/checkout.sh
gsw-launch:
./gsw/scripts/gsw.sh
launch:
./gsw/scripts/launch.sh
reboot:
./gsw/scripts/reboot.sh
log:
./gsw/scripts/log.sh
real-clean:
$(MAKE) clean
./gsw/scripts/real_clean.sh
sc-launch:
./gsw/scripts/sc_launch.sh
stop:
./gsw/scripts/stop.sh