]> git.sur5r.net Git - cc65/blob - src/ld65/make/gcc.mak
Replaced the unused NES target by BBC
[cc65] / src / ld65 / make / gcc.mak
1 #
2 # gcc Makefile for ld65
3 #
4
5 # Library dir
6 COMMON  = ../common
7
8 # Default for the compiler lib search path as compiler define
9 CDEFS=-DCC65_LIB=\"/usr/lib/cc65/lib/\"
10 CFLAGS = -g -O2 -Wall -I$(COMMON) $(CDEFS)
11 CC=gcc
12 LDFLAGS=
13
14 # Perl script for config file conversion
15 CVT=cfg/cvt-cfg.pl
16
17 # -----------------------------------------------------------------------------
18 # List of all object files
19
20 OBJS =  bin.o           \
21         binfmt.o        \
22         condes.o        \
23         config.o        \
24         dbgsyms.o       \
25         error.o         \
26         exports.o       \
27         expr.o          \
28         extsyms.o       \
29         fileio.o        \
30         fragment.o      \
31         global.o        \
32         library.o       \
33         main.o          \
34         mapfile.o       \
35         o65.o           \
36         objdata.o       \
37         objfile.o       \
38         scanner.o       \
39         segments.o      \
40         tgtcfg.o
41
42 # -----------------------------------------------------------------------------
43 # List of all config includes
44
45 INCS =  apple2.inc      \
46         atari.inc       \
47         bbc.inc         \
48         c64.inc         \
49         c128.inc        \
50         cbm610.inc      \
51         geos.inc        \
52         none.inc        \
53         pet.inc         \
54         plus4.inc
55
56 # -----------------------------------------------------------------------------
57 #
58
59 LIBS = $(COMMON)/common.a
60
61
62 EXECS = ld65
63
64 .PHONY: all
65 ifeq (.depend,$(wildcard .depend))
66 all : $(EXECS)
67 include .depend
68 else
69 all:    depend
70         @$(MAKE) -f make/gcc.mak all
71 endif
72
73
74
75 ld65:   $(INCS) $(OBJS) $(LIBS)
76         $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
77
78 inc:    $(INCS)
79
80 clean:
81         rm -f *~ core *.map
82
83 zap:    clean
84         rm -f *.o $(INCS) $(EXECS) .depend
85
86
87 # ------------------------------------------------------------------------------
88 # Make the dependencies
89
90 .PHONY: depend dep
91 depend dep:     $(OBJS:.o=.c)
92         @echo "Creating dependency information"
93         $(CC) -I$(COMMON) -MM -MG $^ > .depend
94
95 # -----------------------------------------------------------------------------
96 # Rules to make config includes
97
98 apple2.inc:     cfg/apple2.cfg
99         @$(CVT) $< $@ CfgApple2
100
101 atari.inc:      cfg/atari.cfg
102         @$(CVT) $< $@ CfgAtari
103
104 bbc.inc:        cfg/bbc.cfg
105         @$(CVT) $< $@ CfgBBC
106
107 c64.inc:        cfg/c64.cfg
108         @$(CVT) $< $@ CfgC64
109
110 c128.inc:       cfg/c128.cfg
111         @$(CVT) $< $@ CfgC128
112
113 cbm610.inc:     cfg/cbm610.cfg
114         @$(CVT) $< $@ CfgCBM610
115
116 geos.inc:       cfg/geos.cfg
117         @$(CVT) $< $@ CfgGeos
118
119 none.inc:       cfg/none.cfg
120         @$(CVT) $< $@ CfgNone
121
122 pet.inc:        cfg/pet.cfg
123         @$(CVT) $< $@ CfgPET
124
125 plus4.inc:      cfg/plus4.cfg
126         @$(CVT) $< $@ CfgPlus4
127
128