forked from nasa/nos3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
130 lines (100 loc) · 2.82 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
121
122
123
124
125
126
127
128
129
130
#
# Top Level Mission Makefile
#
BUILDTYPE ?= debug
INSTALLPREFIX ?= exe
FSWBUILDDIR ?= $(CURDIR)/fsw/build
GSWBUILDDIR ?= $(CURDIR)/gsw/build
SIMBUILDDIR ?= $(CURDIR)/sims/build
export CFS_APP_PATH = ../components
export MISSION_DEFS = ../cfg/build/
export MISSIONCONFIG = ../cfg/build/nos3
# 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 checkout clean clean-fsw clean-sim clean-gsw config debug fsw gsw launch log prep real-clean sim stop stop-gsw
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)
#
# Commands
#
all:
$(MAKE) config
$(MAKE) fsw
$(MAKE) sim
$(MAKE) gsw
build-cryptolib:
mkdir -p $(GSWBUILDDIR)
cd $(GSWBUILDDIR) && cmake $(PREP_OPTS) -DSUPPORT=1 ../../components/cryptolib
$(MAKE) --no-print-directory -C $(GSWBUILDDIR)
build-fsw:
mkdir -p $(FSWBUILDDIR)
cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) ../cfe
$(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install
build-sim:
mkdir -p $(SIMBUILDDIR)
cd $(SIMBUILDDIR) && cmake -DCMAKE_INSTALL_PREFIX=$(SIMBUILDDIR) ..
$(MAKE) --no-print-directory -C $(SIMBUILDDIR) install
build-test:
mkdir -p $(FSWBUILDDIR)
cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) -DENABLE_UNIT_TESTS=true ../cfe
$(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install
checkout:
./scripts/docker_checkout.sh
clean:
$(MAKE) clean-fsw
$(MAKE) clean-sim
$(MAKE) clean-gsw
rm -rf cfg/build
clean-fsw:
rm -rf cfg/build/nos3_defs
rm -rf fsw/build
clean-sim:
rm -rf sims/build
clean-gsw:
rm -rf gsw/build
rm -rf gsw/cosmos/build
rm -rf /tmp/nos3
config:
./scripts/config.sh
debug:
./scripts/docker_debug.sh
fsw:
./scripts/docker_build_fsw.sh
gsw:
./scripts/docker_build_cryptolib.sh
./cfg/build/gsw_build.sh
launch:
./scripts/docker_launch.sh
log:
./scripts/log.sh
prep:
./scripts/prepare.sh
real-clean:
$(MAKE) clean
./scripts/real_clean.sh
sim:
./scripts/docker_build_sim.sh
stop:
./scripts/docker_stop.sh
./scripts/stop.sh
stop-gsw:
./scripts/stop_gsw.sh
test-fsw:
cd $(FSWBUILDDIR)/amd64-posix/default_cpu1 && ctest -O ctest.log
igniter:
./scripts/igniter_launch.sh