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
22 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
62 # -----------------------------------------------------------------------------
63 # List of all config includes
86 LIBS = $(COMMON)/common.a
89 # ------------------------------------------------------------------------------
92 # Main target - must be first
94 ifeq (.depend,$(wildcard .depend))
99 @$(MAKE) -f make/gcc.mak all
102 $(EXE): $(INCS) $(OBJS) $(LIBS)
103 $(CC) $(OBJS) $(LIBS) $(LDFLAGS) -o $@
104 @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
109 $(RM) *~ core.* *.map
112 $(RM) *.o $(INCS) $(EXE) .depend
114 # ------------------------------------------------------------------------------
115 # Make the dependencies
118 depend dep: $(OBJS:.o=.c)
119 @echo "Creating dependency information"
120 $(CC) $(CFLAGS) -MM -MG $^ > .depend
122 # -----------------------------------------------------------------------------
123 # Rules to make config includes
125 apple2.inc: cfg/apple2.cfg
126 @$(CVT) $< $@ CfgApple2
128 # The apple2enh target uses the same config as the apple2
129 apple2enh.inc: cfg/apple2.cfg
130 @$(CVT) $< $@ CfgApple2Enh
132 atari.inc: cfg/atari.cfg
133 @$(CVT) $< $@ CfgAtari
135 atmos.inc: cfg/atmos.cfg
136 @$(CVT) $< $@ CfgAtmos
147 c128.inc: cfg/c128.cfg
148 @$(CVT) $< $@ CfgC128
150 cbm510.inc: cfg/cbm510.cfg
151 @$(CVT) $< $@ CfgCBM510
153 cbm610.inc: cfg/cbm610.cfg
154 @$(CVT) $< $@ CfgCBM610
156 geos.inc: cfg/geos.cfg
157 @$(CVT) $< $@ CfgGeos
159 lunix.inc: cfg/lunix.cfg
160 @$(CVT) $< $@ CfgLunix
162 lynx.inc: cfg/lynx.cfg
163 @$(CVT) $< $@ CfgLynx
165 module.inc: cfg/module.cfg
166 @$(CVT) $< $@ CfgModule
171 none.inc: cfg/none.cfg
172 @$(CVT) $< $@ CfgNone
177 plus4.inc: cfg/plus4.cfg
178 @$(CVT) $< $@ CfgPlus4
180 supervision.inc: cfg/supervision.cfg
181 @$(CVT) $< $@ CfgSupervision
183 vic20.inc: cfg/vic20.cfg
184 @$(CVT) $< $@ CfgVic20