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