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
89 LIBS = $(COMMON)/common.a
92 # ------------------------------------------------------------------------------
95 # Main target - must be first
97 ifeq (.depend,$(wildcard .depend))
102 @$(MAKE) -f make/gcc.mak all
105 $(EXE): $(INCS) $(OBJS) $(LIBS)
106 $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
107 @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
112 $(RM) *~ core.* *.map
115 $(RM) *.o $(INCS) $(EXE) .depend
117 # ------------------------------------------------------------------------------
118 # Make the dependencies
121 depend dep: $(INCS) $(OBJS:.o=.c)
122 @echo "Creating dependency information"
123 $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
125 # -----------------------------------------------------------------------------
126 # Rules to make config includes
128 apple2.inc: cfg/apple2.cfg
129 @$(CVT) $< $@ CfgApple2
131 apple2enh.inc: cfg/apple2enh.cfg
132 @$(CVT) $< $@ CfgApple2Enh
134 atari.inc: cfg/atari.cfg
135 @$(CVT) $< $@ CfgAtari
137 atmos.inc: cfg/atmos.cfg
138 @$(CVT) $< $@ CfgAtmos
149 c128.inc: cfg/c128.cfg
150 @$(CVT) $< $@ CfgC128
152 cbm510.inc: cfg/cbm510.cfg
153 @$(CVT) $< $@ CfgCBM510
155 cbm610.inc: cfg/cbm610.cfg
156 @$(CVT) $< $@ CfgCBM610
158 geos-cbm.inc: cfg/geos-cbm.cfg
159 @$(CVT) $< $@ CfgGeosCBM
161 lunix.inc: cfg/lunix.cfg
162 @$(CVT) $< $@ CfgLunix
164 lynx.inc: cfg/lynx.cfg
165 @$(CVT) $< $@ CfgLynx
167 module.inc: cfg/module.cfg
168 @$(CVT) $< $@ CfgModule
173 none.inc: cfg/none.cfg
174 @$(CVT) $< $@ CfgNone
179 plus4.inc: cfg/plus4.cfg
180 @$(CVT) $< $@ CfgPlus4
182 supervision.inc: cfg/supervision.cfg
183 @$(CVT) $< $@ CfgSupervision
185 vic20.inc: cfg/vic20.cfg
186 @$(CVT) $< $@ CfgVic20