]> git.sur5r.net Git - cc65/blob - src/ld65/make/gcc.mak
New target: supervision
[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 -W -I$(COMMON) $(CDEFS)
11 CC=gcc
12 EBIND=emxbind
13 LDFLAGS=
14
15 # Perl script for config file conversion
16 CVT=cfg/cvt-cfg.pl
17
18 # -----------------------------------------------------------------------------
19 # List of all object files
20
21 OBJS =  asserts.o       \
22         bin.o           \
23         binfmt.o        \
24         condes.o        \
25         config.o        \
26         dbgfile.o       \
27         dbginfo.o       \
28         dbgsyms.o       \
29         error.o         \
30         exports.o       \
31         expr.o          \
32         extsyms.o       \
33         fileinfo.o      \
34         fileio.o        \
35         filepath.o      \
36         fragment.o      \
37         global.o        \
38         library.o       \
39         lineinfo.o      \
40         main.o          \
41         mapfile.o       \
42         o65.o           \
43         objdata.o       \
44         objfile.o       \
45         scanner.o       \
46         segments.o      \
47         spool.o         \
48         tgtcfg.o
49
50 # -----------------------------------------------------------------------------
51 # List of all config includes
52
53 INCS =  apple2.inc      \
54         atari.inc       \
55         atmos.inc       \
56         bbc.inc         \
57         c128.inc        \
58         c16.inc         \
59         c64.inc         \
60         cbm510.inc      \
61         cbm610.inc      \
62         geos.inc        \
63         lunix.inc       \
64         module.inc      \
65         nes.inc         \
66         none.inc        \
67         pet.inc         \
68         plus4.inc       \
69         supervision.inc \
70         vic20.inc
71
72 # -----------------------------------------------------------------------------
73 #
74
75 LIBS = $(COMMON)/common.a
76
77
78 EXECS = ld65
79
80 .PHONY: all
81 ifeq (.depend,$(wildcard .depend))
82 all : $(EXECS)
83 include .depend
84 else
85 all:    depend
86         @$(MAKE) -f make/gcc.mak all
87 endif
88
89
90
91 ld65:   $(INCS) $(OBJS) $(LIBS)
92         $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
93         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $@ ; fi
94
95 inc:    $(INCS)
96
97 clean:
98         $(RM) *~ core *.map
99
100 zap:    clean
101         $(RM) *.o $(INCS) $(EXECS) .depend
102
103
104 # ------------------------------------------------------------------------------
105 # Make the dependencies
106
107 .PHONY: depend dep
108 depend dep:     $(OBJS:.o=.c)
109         @echo "Creating dependency information"
110         $(CC) -I$(COMMON) -MM -MG $^ > .depend
111
112 # -----------------------------------------------------------------------------
113 # Rules to make config includes
114
115 apple2.inc:     cfg/apple2.cfg
116         @$(CVT) $< $@ CfgApple2
117
118 atari.inc:      cfg/atari.cfg
119         @$(CVT) $< $@ CfgAtari
120
121 atmos.inc:      cfg/atmos.cfg
122         @$(CVT) $< $@ CfgAtmos
123
124 bbc.inc:        cfg/bbc.cfg
125         @$(CVT) $< $@ CfgBBC
126
127 c16.inc:        cfg/c16.cfg
128         @$(CVT) $< $@ CfgC16
129
130 c64.inc:        cfg/c64.cfg
131         @$(CVT) $< $@ CfgC64
132
133 c128.inc:       cfg/c128.cfg
134         @$(CVT) $< $@ CfgC128
135
136 cbm510.inc:     cfg/cbm510.cfg
137         @$(CVT) $< $@ CfgCBM510
138
139 cbm610.inc:     cfg/cbm610.cfg
140         @$(CVT) $< $@ CfgCBM610
141
142 geos.inc:       cfg/geos.cfg
143         @$(CVT) $< $@ CfgGeos
144
145 lunix.inc:      cfg/lunix.cfg
146         @$(CVT) $< $@ CfgLunix
147
148 module.inc:     cfg/module.cfg
149         @$(CVT) $< $@ CfgModule
150
151 nes.inc:        cfg/nes.cfg
152         @$(CVT) $< $@ CfgNES
153
154 none.inc:       cfg/none.cfg
155         @$(CVT) $< $@ CfgNone
156
157 pet.inc:        cfg/pet.cfg
158         @$(CVT) $< $@ CfgPET
159
160 plus4.inc:      cfg/plus4.cfg
161         @$(CVT) $< $@ CfgPlus4
162
163 supervision.inc:        cfg/supervision.cfg
164         @$(CVT) $< $@ CfgSupervision
165
166 vic20.inc:      cfg/vic20.cfg
167         @$(CVT) $< $@ CfgVic20
168
169