]> git.sur5r.net Git - cc65/blob - src/common/make/gcc.mak
Add an include file
[cc65] / src / common / make / gcc.mak
1 #
2 # gcc Makefile for the binutils common stuff
3 #
4
5 CFLAGS  = -g -O2 -Wall
6 CC      = gcc
7 LDFLAGS =
8 LIB     = common.a
9
10
11
12 OBJS =  abend.o         \
13         bitops.o        \
14         check.o         \
15         cmdline.o       \
16         coll.o          \
17         exprdefs.o      \
18         fname.o         \
19         hashstr.o       \
20         target.o        \
21         tgttrans.o      \
22         xmalloc.o       \
23         xsprintf.o
24
25
26 # ------------------------------------------------------------------------------
27 # Dummy targets
28
29 .PHONY: all
30 ifeq (.depend,$(wildcard .depend))
31 all:    lib
32 include .depend
33 else
34 all:    depend
35         @$(MAKE) -f make/gcc.mak all
36 endif
37
38 .PHONY: lib
39 lib:    $(LIB)
40
41 $(LIB): $(OBJS)
42         $(AR) rs $(LIB) $?
43
44 clean:
45         rm -f *~ core *.map
46
47 zap:    clean
48         rm -f *.o $(LIB) .depend
49
50 # ------------------------------------------------------------------------------
51 # Make the dependencies
52
53 .PHONY: depend dep
54 depend dep:     $(OBJS:.o=.c)
55         @echo "Creating dependency information"
56         $(CC) -MM $^ > .depend
57
58
59
60