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