-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
64 lines (46 loc) · 1.46 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
CC ?= gcc
V ?= 0
-include config.mk
CFLAGS+=-Wextra -Wall -Wno-unused-parameter \
-Wstrict-prototypes -Wmissing-prototypes -O0 -g
CPPFLAGS+=$(DEP_CFLAGS) -D_GNU_SOURCE
LDLIBS+=$(DEP_LIBS) -lm
HEADERS := $(wildcard *.h)
OBJS := wesgr.o parse.o graphdata.o handler.o resdata.o
EXE := wesgr
GENERATED := config.mk
all: $(EXE)
demo: tgraph1.svg tgraph2.svg sample3-overview.svg sample3-detail.svg
.PHONY: clean demo
clean:
rm -f *.o $(EXE) $(GENERATED)
$(EXE): $(OBJS)
$(M_V_LINK)$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
$(OBJS): $(HEADERS) config.mk
resdata.o: legend.xml style.css
PKG_DEPS := json-c >= 0.11
config.mk: Makefile
$(M_V_GEN)\
echo "DEP_CFLAGS=`pkg-config --cflags '$(PKG_DEPS)'`" > $@ && \
echo "DEP_LIBS=`pkg-config --libs '$(PKG_DEPS)'`" >> $@
tgraph1.svg: $(EXE) style.css
./$(EXE) -i testdata/timeline-1.log -o $@ -a 413 -b 620
tgraph2.svg: $(EXE) style.css
./$(EXE) -i testdata/timeline-2.log -o $@
sample3-overview.svg: $(EXE) style.css
./$(EXE) -i testdata/timeline-3.log -o $@
sample3-detail.svg: $(EXE) style.css
./$(EXE) -i testdata/timeline-3.log -o $@ -a 26000 -b 26100
%.o: %.c
$(M_V_CC)$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
%.o: %.S
$(M_V_AS)$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c -o $@ $<
.SUFFIXES:
m_v_cc_0 = @echo " CC " $@;
M_V_CC = $(m_v_cc_$(V))
m_v_as_0 = @echo " CCAS " $@;
M_V_AS = $(m_v_as_$(V))
m_v_link_0 = @echo " LINK " $@;
M_V_LINK = $(m_v_link_$(V))
m_v_gen_0 = @echo " GEN " $@;
M_V_GEN = $(m_v_gen_$(V))