2 # gcc Makefile for ld65
5 # ------------------------------------------------------------------------------
7 # The executable to build
13 # Several search paths. You may redefine these on the command line
14 LD65_LIB = \"/usr/lib/cc65/lib/\"
15 LD65_OBJ = \"/usr/lib/cc65/lib/\"
16 LD65_CFG = \"/usr/lib/cc65/cfg/\"
20 CFLAGS = -g -O2 -Wall -W -std=c89
21 override CFLAGS += -I$(COMMON)
22 override CFLAGS += -DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD65_CFG)
26 # Perl script for config file conversion
29 # -----------------------------------------------------------------------------
30 # List of all object files
65 # -----------------------------------------------------------------------------
66 # List of all config includes
90 LIBS = $(COMMON)/common.a
93 # ------------------------------------------------------------------------------
96 # Main target - must be first
98 ifeq (.depend,$(wildcard .depend))
103 @$(MAKE) -f make/gcc.mak all
106 $(EXE): $(INCS) $(OBJS) $(LIBS)
107 $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
108 @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
113 $(RM) *~ core.* *.map
116 $(RM) *.o $(INCS) $(EXE) .depend
118 # ------------------------------------------------------------------------------
119 # Make the dependencies
122 depend dep: $(INCS) $(OBJS:.o=.c)
123 @echo "Creating dependency information"
124 $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
126 # -----------------------------------------------------------------------------
127 # Rules to make config includes
129 apple2.inc: cfg/apple2.cfg
130 @$(CVT) $< $@ CfgApple2
132 apple2enh.inc: cfg/apple2enh.cfg
133 @$(CVT) $< $@ CfgApple2Enh
135 atari.inc: cfg/atari.cfg
136 @$(CVT) $< $@ CfgAtari
138 atmos.inc: cfg/atmos.cfg
139 @$(CVT) $< $@ CfgAtmos
150 c128.inc: cfg/c128.cfg
151 @$(CVT) $< $@ CfgC128
153 cbm510.inc: cfg/cbm510.cfg
154 @$(CVT) $< $@ CfgCBM510
156 cbm610.inc: cfg/cbm610.cfg
157 @$(CVT) $< $@ CfgCBM610
159 geos-apple.inc: cfg/geos-apple.cfg
160 @$(CVT) $< $@ CfgGeosApple
162 geos-cbm.inc: cfg/geos-cbm.cfg
163 @$(CVT) $< $@ CfgGeosCBM
165 lunix.inc: cfg/lunix.cfg
166 @$(CVT) $< $@ CfgLunix
168 lynx.inc: cfg/lynx.cfg
169 @$(CVT) $< $@ CfgLynx
171 module.inc: cfg/module.cfg
172 @$(CVT) $< $@ CfgModule
177 none.inc: cfg/none.cfg
178 @$(CVT) $< $@ CfgNone
183 plus4.inc: cfg/plus4.cfg
184 @$(CVT) $< $@ CfgPlus4
186 supervision.inc: cfg/supervision.cfg
187 @$(CVT) $< $@ CfgSupervision
189 vic20.inc: cfg/vic20.cfg
190 @$(CVT) $< $@ CfgVic20