-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
61 lines (46 loc) · 1.48 KB
/
Makefile.in
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
CC=@CC@
CFLAGS=-iquote @srcdir@/include @CFLAGS@
LDFLAGS=@LDFLAGS@
LIBS=@LIBS@
AWK=@AWK@
PRINTF=@PRINTF@
RM=@RM@
hsrc=$(wildcard script/*-header.awk)
hdr=$(hsrc:script/%-header.awk=@srcdir@/include/%.h)
ascript=$(wildcard script/*-source.awk)
dycsrc=$(ascript:script/%-source.awk=@srcdir@/src/%.c)
csrc=$(sort $(wildcard @srcdir@/src/*.c) $(dycsrc))
obj=$(csrc:@srcdir@/src/%.c=./%.o)
all: exprtree
exprtree: $(obj)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
help:
@ $(PRINTF) "Options:\n\n"
@ $(PRINTF) "\tall\n"
@ $(PRINTF) "\theaders\n"
@ $(PRINTF) "\tsource\n"
@ $(PRINTF) "\tclean\n"
@ $(PRINTF) "\n"
headers: $(hdr)
source: $(dycsrc)
@srcdir@/include/%.h: script/%-header.awk @srcdir@/include
@$(AWK) -f $< @srcdir@/src/template/tokens.tbl > $@
@$(PRINTF) "AWK\t$(notdir $<)\n\t|\n\t*=> $(notdir $@)\n\n"
@srcdir@/src/%.c: script/%-source.awk
@$(RM) -f $@
@$(AWK) -f $< @srcdir@/src/template/tokens.tbl > $@
@$(PRINTF) "AWK\t$(notdir $<)\n\t|\n\t*=> $(notdir $@)\n\n"
./%.o: @srcdir@/src/%.c source headers
@$(CC) $(CFLAGS) -c $< -o $@
@$(PRINTF) "CC\t$(notdir $<)\n\t|\n\t*=> $(notdir $@)\n\n"
clean:
@$(RM) -f $(wildcard exprtree)
@$(RM) -f $(wildcard $(hdr))
@$(RM) -f $(wildcard $(dycsrc))
@$(RM) -f $(wildcard $(obj))
@$(PRINTF) "RM\t%s\n" \
$(notdir $(wildcard $(hdr))) \
$(notdir $(wildcard $(dycsrc))) \
$(notdir $(wildcard $(obj)))
distclean: clean
$(RM) -rf Makefile @srcdir@/configure config.status config.log @srcdir@/autom4te.cache/ script/*.awk script/*.sed