]> git.sur5r.net Git - cc65/blob - src/ld65/make/gcc.mak
More debug file output
[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         vic20.inc
70
71 # -----------------------------------------------------------------------------
72 #
73
74 LIBS = $(COMMON)/common.a
75
76
77 EXECS = ld65
78
79 .PHONY: all
80 ifeq (.depend,$(wildcard .depend))
81 all : $(EXECS)
82 include .depend
83 else
84 all:    depend
85         @$(MAKE) -f make/gcc.mak all
86 endif
87
88
89
90 ld65:   $(INCS) $(OBJS) $(LIBS)
91         $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
92         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $@ ; fi
93
94 inc:    $(INCS)
95
96 clean:
97         $(RM) *~ core *.map
98
99 zap:    clean
100         $(RM) *.o $(INCS) $(EXECS) .depend
101
102
103 # ------------------------------------------------------------------------------
104 # Make the dependencies
105
106 .PHONY: depend dep
107 depend dep:     $(OBJS:.o=.c)
108         @echo "Creating dependency information"
109         $(CC) -I$(COMMON) -MM -MG $^ > .depend
110
111 # -----------------------------------------------------------------------------
112 # Rules to make config includes
113
114 apple2.inc:     cfg/apple2.cfg
115         @$(CVT) $< $@ CfgApple2
116
117 atari.inc:      cfg/atari.cfg
118         @$(CVT) $< $@ CfgAtari
119
120 atmos.inc:      cfg/atmos.cfg
121         @$(CVT) $< $@ CfgAtmos
122
123 bbc.inc:        cfg/bbc.cfg
124         @$(CVT) $< $@ CfgBBC
125
126 c16.inc:        cfg/c16.cfg
127         @$(CVT) $< $@ CfgC16
128
129 c64.inc:        cfg/c64.cfg
130         @$(CVT) $< $@ CfgC64
131
132 c128.inc:       cfg/c128.cfg
133         @$(CVT) $< $@ CfgC128
134
135 cbm510.inc:     cfg/cbm510.cfg
136         @$(CVT) $< $@ CfgCBM510
137
138 cbm610.inc:     cfg/cbm610.cfg
139         @$(CVT) $< $@ CfgCBM610
140
141 geos.inc:       cfg/geos.cfg
142         @$(CVT) $< $@ CfgGeos
143
144 lunix.inc:      cfg/lunix.cfg
145         @$(CVT) $< $@ CfgLunix
146
147 module.inc:     cfg/module.cfg
148         @$(CVT) $< $@ CfgModule
149
150 nes.inc:        cfg/nes.cfg
151         @$(CVT) $< $@ CfgNES
152
153 none.inc:       cfg/none.cfg
154         @$(CVT) $< $@ CfgNone
155
156 pet.inc:        cfg/pet.cfg
157         @$(CVT) $< $@ CfgPET
158
159 plus4.inc:      cfg/plus4.cfg
160         @$(CVT) $< $@ CfgPlus4
161
162 vic20.inc:      cfg/vic20.cfg
163         @$(CVT) $< $@ CfgVic20
164
165