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
)
8 GRAPH_FILE
= callgraph.ps
10 TEST_SCRIPT
= das-tests
12 ifneq ($(findstring $(MAKEFLAGS
),s
),s
)
14 QUIET_CC
= @echo
' ' CC
$@
;
15 QUIET_LD
= @echo
' ' LD
$@
;
16 QUIET_GEN
= @echo
' ' GEN
$@
;
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
$<
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
52 @cd
$(TEST_DIR
) && .
/$(TEST_SCRIPT
)
55 rm -f
$(BIN
) tags *.o
*~ .pass1
*
58 $(QUIET_GEN
)$(CC
) -dr
$(CFILES
)
59 @egypt
*.expand | dot
-Gsize
=100,100 -Grankdir
=LR
-Tps \
65 find .
-name
'*.[hcS]' -print | xargs ctags
-a