-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
92 lines (72 loc) · 4.15 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
LINTER_PARAMS=--extensions=hpp,cpp,h,c --filter=-legal/copyright,-build/include,-runtime/arrays,-runtime/references,-build/c++11,-build/namespaces,-runtime/explicit,-runtime/printf,-runtime/int,-readability/inheritance,-readability/alt_tokens,-runtime/threadsafe_fn --linelength=120
SOURCES := $(shell find . -type f \( -name "*.cpp" -o -name "*.h" \) | grep -v "AVR-HAL" | grep -v "cmake-build-")
all: PLD_build PLD_unit_tests EPS_A_build EPS_A_unit_tests EPS_B_build EPS_B_unit_tests SunS_build SunS_unit_tests EGSE checkStyle checkFormat
.PHONY: checkStyle format checkFormat PLD_build SunS_build EPS_A_build EPS_B_build PLD_unit_tests EPS_A_unit_tests EPS_B_unit_tests SunS_unit_tests EGSE
clean:
rm -rf PLD/cmake-build-release
rm -rf EPS_A/cmake-build-release
rm -rf EPS_A/cmake-build-release-logs
rm -rf EPS_B/cmake-build-release
rm -rf EPS_A/cmake-build-release-logs
rm -rf SunS/cmake-build-release-em
rm -rf SunS/cmake-build-release-fm
## -------------------------- STYLE -------------------------------------
checkStyle:
@cpplint $(LINTER_PARAMS) $(SOURCES)
format:
@clang-format-5.0 -i $(SOURCES)
checkFormat:
@! clang-format-5.0 $(SOURCES) -output-replacements-xml | grep -c "<replacement " >/dev/null
@echo "Format OK"
## -------------------------- BUILD PROJECTS -------------------------------------
PLD_build:
cd PLD && mkdir -p cmake-build-release && cd cmake-build-release && cmake .. -DCMAKE_BUILD_TYPE=RELEASE
make -C PLD/cmake-build-release all
EPS_A_build:
cd EPS_A && mkdir -p cmake-build-release && cd cmake-build-release && cmake .. -DCMAKE_BUILD_TYPE=RELEASE
make -C EPS_A/cmake-build-release all
cd EPS_A && mkdir -p cmake-build-release-logs && cd cmake-build-release-logs && cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DLOG_LEVEL=LOG_LEVEL_DEBUG
make -C EPS_A/cmake-build-release-logs all
EPS_B_build:
cd EPS_B && mkdir -p cmake-build-release && cd cmake-build-release && cmake .. -DCMAKE_BUILD_TYPE=RELEASE
make -C EPS_B/cmake-build-release all
cd EPS_B && mkdir -p cmake-build-release-logs && cd cmake-build-release-logs && cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DLOG_LEVEL=LOG_LEVEL_DEBUG
make -C EPS_B/cmake-build-release-logs all
SunS_build:
cd SunS && mkdir -p cmake-build-release-em && cd cmake-build-release-em && cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DPLATFORM=EM
make -C SunS/cmake-build-release-em all
cd SunS && mkdir -p cmake-build-release-fm && cd cmake-build-release-fm && cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DPLATFORM=FM
make -C SunS/cmake-build-release-fm all
## -------------------------- RUN TESTS -------------------------------------
PLD_unit_tests:
make -C PLD/cmake-build-release unit_tests_a.run
make -C PLD/cmake-build-release unit_tests_b.run
make -C PLD/cmake-build-release unit_tests_pld.run
EPS_A_unit_tests:
make -C EPS_A/cmake-build-release unit_tests_a.run
make -C EPS_A/cmake-build-release unit_tests_b.run
make -C EPS_A/cmake-build-release eps_unit_tests.run
make -C EPS_A/cmake-build-release-logs unit_tests_a.run
make -C EPS_A/cmake-build-release-logs unit_tests_b.run
make -C EPS_A/cmake-build-release-logs eps_unit_tests.run
EPS_B_unit_tests:
make -C EPS_B/cmake-build-release unit_tests_a.run
make -C EPS_B/cmake-build-release unit_tests_b.run
make -C EPS_B/cmake-build-release eps_unit_tests.run
make -C EPS_B/cmake-build-release-logs unit_tests_a.run
make -C EPS_B/cmake-build-release-logs unit_tests_b.run
make -C EPS_B/cmake-build-release-logs eps_unit_tests.run
SunS_unit_tests:
make -C SunS/cmake-build-release-em unit_tests_a.run
make -C SunS/cmake-build-release-em unit_tests_b.run
make -C SunS/cmake-build-release-fm unit_tests_a.run
make -C SunS/cmake-build-release-fm unit_tests_b.run
## -------------------------- NON-FLIGHT STUFF -------------------------------------
EGSE:
mkdir -p EGSE/OBCMock/firmware/cmake-build-release
cd EGSE/OBCMock/firmware/cmake-build-release && cmake .. -DCMAKE_BUILD_TYPE=RELEASE
make -C EGSE/OBCMock/firmware/cmake-build-release I2C_bridge.build
EGSE-SunS:
mkdir -p EGSE/SunS_Fixture/firmware/cmake-build-release
cd EGSE/SunS_Fixture/firmware/cmake-build-release && cmake .. -DCMAKE_BUILD_TYPE=RELEASE
make -C EGSE/SunS_Fixture/firmware/cmake-build-release I2C_bridge.build