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