Kill mega-sena.sh
[lcapit-junk-code.git] / DLW-1e / das / Makefile
blob8631bc5c502a8b5808ec051e6f5a9ed0b35f28d6
1 CC = gcc
2 CFLAGS = -Wall -W -Wmissing-declarations -Wmissing-prototypes -g -O0 \
3 -Wredundant-decls -Wshadow -Wbad-function-cast -Wcast-qual
4 HEADERS = pass1.h pass2.h error.h
5 CFILES = das.c pass1.c pass2.c file.c opcode.c error.c symbol_tbl.c
6 OBJS := $(CFILES:.c=.o)
7 BIN = das create_bin
8 GRAPH_FILE = callgraph.ps
9 TEST_DIR = tests
10 TEST_SCRIPT = das-tests
12 ifneq ($(findstring $(MAKEFLAGS),s),s)
13 ifndef V
14 QUIET_CC = @echo ' ' CC $@;
15 QUIET_LD = @echo ' ' LD $@;
16 QUIET_GEN = @echo ' ' GEN $@;
17 endif
18 endif
20 all: das
22 das: $(OBJS)
23 $(QUIET_LD)$(CC) -o $@ $+
25 das.o: das.c $(HEADERS)
26 $(QUIET_CC)$(CC) $(CFLAGS) -c $<
28 pass1.o: pass1.c pass1.h file.h symbol_tbl.h error.h
29 $(QUIET_CC)$(CC) $(CFLAGS) -c $<
31 pass2.o: pass2.c pass2.h opcode.h file.h symbol_tbl.h error.h
32 $(QUIET_CC)$(CC) $(CFLAGS) -c $<
34 opcode.o: opcode.c opcode.h
35 $(QUIET_CC)$(CC) $(CFLAGS) -c $<
37 error.o: error.c error.h
38 $(QUIET_CC)$(CC) $(CFLAGS) -c $<
40 file.o: file.c file.h
41 $(QUIET_CC)$(CC) $(CFLAGS) -c $<
43 symbol_tbl.o: symbol_tbl.c symbol_tbl.h
44 $(QUIET_CC)$(CC) $(CFLAGS) -c $<
46 create_bin: create_bin.c
47 $(QUIET_CC)$(CC) -o $@ $<
49 .PHONY: check clean callgraph tags
51 check: das
52 @cd $(TEST_DIR) && ./$(TEST_SCRIPT)
54 clean:
55 rm -f $(BIN) tags *.o *~ .pass1*
57 callgraph:
58 $(QUIET_GEN)$(CC) -dr $(CFILES)
59 @egypt *.expand | dot -Gsize=100,100 -Grankdir=LR -Tps \
60 -o $(GRAPH_FILE)
61 @rm -f *.expand a.out
63 tags:
64 rm -f tags
65 find . -name '*.[hcS]' -print | xargs ctags -a