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
64 # -----------------------------------------------------------------------------
65 # List of all config includes
88 LIBS = $(COMMON)/common.a
91 # ------------------------------------------------------------------------------
94 # Main target - must be first
96 ifeq (.depend,$(wildcard .depend))
101 @$(MAKE) -f make/gcc.mak all
104 $(EXE): $(INCS) $(OBJS) $(LIBS)
105 $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
106 @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
111 $(RM) *~ core.* *.map
114 $(RM) *.o $(INCS) $(EXE) .depend
116 # ------------------------------------------------------------------------------
117 # Make the dependencies
120 depend dep: $(INCS) $(OBJS:.o=.c)
121 @echo "Creating dependency information"
122 $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
124 # -----------------------------------------------------------------------------
125 # Rules to make config includes
127 apple2.inc: cfg/apple2.cfg
128 @$(CVT) $< $@ CfgApple2
130 apple2enh.inc: cfg/apple2enh.cfg
131 @$(CVT) $< $@ CfgApple2Enh
133 atari.inc: cfg/atari.cfg
134 @$(CVT) $< $@ CfgAtari
136 atmos.inc: cfg/atmos.cfg
137 @$(CVT) $< $@ CfgAtmos
148 c128.inc: cfg/c128.cfg
149 @$(CVT) $< $@ CfgC128
151 cbm510.inc: cfg/cbm510.cfg
152 @$(CVT) $< $@ CfgCBM510
154 cbm610.inc: cfg/cbm610.cfg
155 @$(CVT) $< $@ CfgCBM610
157 geos.inc: cfg/geos.cfg
158 @$(CVT) $< $@ CfgGeos
160 lunix.inc: cfg/lunix.cfg
161 @$(CVT) $< $@ CfgLunix
163 lynx.inc: cfg/lynx.cfg
164 @$(CVT) $< $@ CfgLynx
166 module.inc: cfg/module.cfg
167 @$(CVT) $< $@ CfgModule
172 none.inc: cfg/none.cfg
173 @$(CVT) $< $@ CfgNone
178 plus4.inc: cfg/plus4.cfg
179 @$(CVT) $< $@ CfgPlus4
181 supervision.inc: cfg/supervision.cfg
182 @$(CVT) $< $@ CfgSupervision
184 vic20.inc: cfg/vic20.cfg
185 @$(CVT) $< $@ CfgVic20