-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
61 lines (44 loc) · 1.34 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
# Following line must stay on line 2, otherwise Release.sh will not work anymore.
C1_DIR = ./lib/fwprofile/src
C1_SRC = $(shell find $(C1_DIR) -name '*.c')
C1_OBJ = $(patsubst $(C1_DIR)/%.c,$(OUT)/%.o,$(C1_SRC))
DA_DIR = ./src/app
DA_SRC = $(shell find $(DA_DIR) -name 'FwDa*.c')
DA_OBJ = $(patsubst $(DA_DIR)/%c,$(OUT)/%o,$(DA_SRC))
PR_DIR = ./src/pr_tutorials
RT_DIR = ./src/rt_tutorials
SM_DIR = ./src/sm_tutorials
CC ?= gcc
CFLAGS = -O0 -g3 -Wall -c -fmessage-length=0 -fprofile-arcs -ftest-coverage -I$(C1_DIR)
LFLAGS = -fprofile-arcs
LIBS = -lpthread
OUT = bin
.PHONY: all create_dir clean C1 run-all
all: create_dir C1 $(OUT)/sm_demo $(OUT)/RtExample1 $(OUT)/PrExample1 $(OUT)/SmExample1 $(OUT)/SmExample2 $(OUT)/SmExample3
run-all:
./$(OUT)/sm_demo
./$(OUT)/RtExample1
./$(OUT)/PrExample1
./$(OUT)/SmExample1
./$(OUT)/SmExample2
./$(OUT)/SmExample3
C1: $(C1_OBJ)
$(OUT)/%: bin/FwProfile_%.o $(C1_OBJ)
$(CC) $(LFLAGS) -o $@ $? $(LIBS)
$(OUT)/sm_demo: $(DA_OBJ) $(C1_OBJ)
$(CC) $(LFLAGS) -o $@ $? $(LIBS)
$(OUT)/%.o: $(SM_DIR)/%.c
$(CC) $(CFLAGS) -o $@ $<
$(OUT)/%.o: $(RT_DIR)/%.c
$(CC) $(CFLAGS) -o $@ $<
$(OUT)/%.o: $(PR_DIR)/%.c
$(CC) $(CFLAGS) -o $@ $<
$(OUT)/%.o: $(DA_DIR)/%.c
$(CC) $(CFLAGS) -o $@ $<
$(OUT)/%.o: $(C1_DIR)/%.c
$(CC) $(CFLAGS) -o $@ $<
print-%: ; @echo $*=$($*)
create_dir:
mkdir -p $(OUT)
clean:
rm $(OUT) -rf