/
Makefile
120 lines (87 loc) · 2.59 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
# vim: noexpandtab
CC=gcc
CPPC=clang++
#CC=clang
MAKE=make
LIBDS=-L../lib
#ifndef MANAGED
#GDSL_AVR:=1
#GDSL_X86:=1
#endif
#$(info $(MANAGED))
DEFINES=-DRELAXEDFATAL
ifdef GDSL_ARCH
UPPER_ARCH = $(shell echo $(GDSL_ARCH) | tr a-z A-Z)
DEFINES+=-DGDSL_$(UPPER_ARCH)
endif
LIBS +=-lgdsl -lrt -lreadhex -lgdsl-multiplex -ldl -lgdutil -lelf
LIBS_MULT +=-lrt -lreadhex -lgdsl-multiplex -ldl -lgdutil -lelf
LIBFLAGS=$(LIBDS) $(LIBS)
LIB_MULTFLAGS=$(LIBDS) $(LIBS_MULT)
LDFLAGS=
INCDS=-I../include
CFLAGS=-c -g3 -std=gnu11 -pedantic -Wall -Wfatal-errors -DRELAXEDFATAL $(DEFINES) $(INCDS)
CPPFLAGS=-c -std=c++11 -ggdb3 $(DEFINES) $(INCDS)
PROJECTS=
EXECUTABLES=semantics-cli decoder-cli semantics-cli-dynamic semantics-cif-cli sweep semantics-opt liveness-sweep cppgdsl-demo
.PHONY: $(PROJECTS) clean-projects
all: $(EXECUTABLES) $(PROJECTS)
### decoder-cli
decoder-cli: decoder-cli.o
$(CC) $(LDFLAGS) decoder-cli.o $(LIBFLAGS) -o $@
decoder-cli.o: decoder-cli.c
$(CC) $(CFLAGS) decoder-cli.c -o $@
### semantics-cli
semantics-cli: semantics-cli.o
$(CC) $(LDFLAGS) semantics-cli.o $(LIBFLAGS) -o $@
semantics-cli.o: semantics-cli.c
$(CC) $(CFLAGS) semantics-cli.c -o $@
### semantics-cli-dynamic
semantics-cli-dynamic: semantics-cli-dynamic.o
$(CC) $(LDFLAGS) semantics-cli-dynamic.o $(LIBFLAGS) -o $@
semantics-cli-dynamic.o: semantics-cli-dynamic.c
$(CC) $(CFLAGS) semantics-cli-dynamic.c -o $@
### semantics-cif-cli
semantics-cif-cli: semantics-cif-cli.o
$(CC) $(LDFLAGS) semantics-cif-cli.o $(LIBFLAGS) -o $@
semantics-cif-cli.o: semantics-cif-cli.c
$(CC) $(CFLAGS) semantics-cif-cli.c -o $@
### cppgdsl-demo
cppgdsl-demo: cppgdsl-demo.o
$(CPPC) $(LDFLAGS) cppgdsl-demo.o -lcppgdsl $(LIB_MULTFLAGS) -o $@
cppgdsl-demo.o: cppgdsl-demo.cpp
$(CPPC) $(CPPFLAGS) cppgdsl-demo.cpp -o $@
### sweep
sweep: sweep.o
$(CC) $(LDFLAGS) sweep.o $(LIBFLAGS) -o $@
sweep.o: sweep.c
$(CC) $(CFLAGS) sweep.c -o $@
### semantics-opt
semantics-opt: semantics-opt.o
$(CC) $(LDFLAGS) semantics-opt.o $(LIBFLAGS) -o $@
semantics-opt.o: semantics-opt.c
$(CC) $(CFLAGS) semantics-opt.c -o $@
### liveness-sweep
liveness-sweep: liveness-sweep.o
$(CC) $(LDFLAGS) liveness-sweep.o $(LIBFLAGS) -o $@
liveness-sweep.o: liveness-sweep.c
$(CC) $(CFLAGS) liveness-sweep.c -o $@
ifeq ($(GDSL_ARCH),x86)
### x86-test-runner
x86-test-runner:
$(MAKE) -C $@
### x86-test-stats-runner
x86-test-stats-runner:
$(MAKE) -C $@
### xed-cmp
xed-cmp:
$(MAKE) -C $@
endif
### tardet
#tardet:
# $(MAKE) -C $@
clean: clean-projects
rm -f $(EXECUTABLES) *.o
clean-projects: $(PROJECTS:=-clean)
$(PROJECTS:=-clean):
$(MAKE) -C $(@:-clean=) clean