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 apple2enh.inc: cfg/apple2enh.cfg
129 @$(CVT) $< $@ CfgApple2Enh
131 atari.inc: cfg/atari.cfg
132 @$(CVT) $< $@ CfgAtari
134 atmos.inc: cfg/atmos.cfg
135 @$(CVT) $< $@ CfgAtmos
146 c128.inc: cfg/c128.cfg
147 @$(CVT) $< $@ CfgC128
149 cbm510.inc: cfg/cbm510.cfg
150 @$(CVT) $< $@ CfgCBM510
152 cbm610.inc: cfg/cbm610.cfg
153 @$(CVT) $< $@ CfgCBM610
155 geos.inc: cfg/geos.cfg
156 @$(CVT) $< $@ CfgGeos
158 lunix.inc: cfg/lunix.cfg
159 @$(CVT) $< $@ CfgLunix
161 lynx.inc: cfg/lynx.cfg
162 @$(CVT) $< $@ CfgLynx
164 module.inc: cfg/module.cfg
165 @$(CVT) $< $@ CfgModule
170 none.inc: cfg/none.cfg
171 @$(CVT) $< $@ CfgNone
176 plus4.inc: cfg/plus4.cfg
177 @$(CVT) $< $@ CfgPlus4
179 supervision.inc: cfg/supervision.cfg
180 @$(CVT) $< $@ CfgSupervision
182 vic20.inc: cfg/vic20.cfg
183 @$(CVT) $< $@ CfgVic20