-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (57 loc) · 1.76 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
# Makefile Project
#SAFE=echo
# Documentation
#
# Every Makefile in this project should have:
#
# Rule:
#
# test: Test if the module is without errors
# bin_tests: Create test binaries but does not run
# full_mod: Create all files needed to import module
#
# Imports
ROOTDIR=$(realpath .)
ifndef CONFIG_SOURCED
CFG_MAKE=$(ROOTDIR)/Config.Makefile
include $(CFG_MAKE)
endif
# Watch command
WDIR=$(ROOTDIR)
# Tests
ALLTESTSRULES=str_utils_bt \
cfg_utils_bt \
list_bt \
stateMachine_bt \
io_manager_bt \
cmdr_bt \
smc_instances_bt
# Colors
COLOR_SGST=$(COLOR_CYAN)
# Local rules
test: test_all #exec_bin_tests
bin_tests: test_all
test_all: $(ALLTESTSRULES)
exec_bin_tests:
$(SAFE) cd $(TST_DIR); \
for i in *.bin; do \
$(LSS) $$i; \
$(ECE) $(COLOR_CYAN); \
$(SAFE) ./$$i || exit 1; \
$(ECE) $(COLOR_RESTORE); \
done
## Binary tests
list_bt: $(shell find $(MODULE_LIST) -type f )
$(SAFE) $(MKC) $(MODULE_LIST) test COLOR_SGST='$(COLOR_SGST)'
stateMachine_bt: $(shell find $(MODULE_STATEMACHINE) -type f )
$(SAFE) $(MKC) $(MODULE_STATEMACHINE) test COLOR_SGST='$(COLOR_SGST)'
smc_instances_bt: $(shell find $(MODULE_INSTANCES_STATEMACHINE) -type f )
$(SAFE) $(MKC) $(MODULE_INSTANCES_STATEMACHINE) test COLOR_SGST='$(COLOR_SGST)'
io_manager_bt: $(shell find $(MODULE_IOMANAGER) -type f )
$(SAFE) $(MKC) $(MODULE_IOMANAGER) test COLOR_SGST='$(COLOR_SGST)'
str_utils_bt: $(shell find $(MODMODULE_STRUTILS) -type f )
$(SAFE) $(MKC) $(MODULE_STRUTILS) test COLOR_SGST='$(COLOR_SGST)'
cfg_utils_bt: $(shell find $(MODMODULE_CFGUTILS) -type f )
$(SAFE) $(MKC) $(MODULE_CFGUTILS) test COLOR_SGST='$(COLOR_SGST)'
cmdr_bt: $(shell find $(MODULE_COMMANDER) -type f )
$(SAFE) $(MKC) $(MODULE_COMMANDER) test COLOR_SGST='$(COLOR_SGST)'