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
63 # -----------------------------------------------------------------------------
64 # List of all config includes
87 LIBS = $(COMMON)/common.a
90 # ------------------------------------------------------------------------------
93 # Main target - must be first
95 ifeq (.depend,$(wildcard .depend))
100 @$(MAKE) -f make/gcc.mak all
103 $(EXE): $(INCS) $(OBJS) $(LIBS)
104 $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
105 @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
110 $(RM) *~ core.* *.map
113 $(RM) *.o $(INCS) $(EXE) .depend
115 # ------------------------------------------------------------------------------
116 # Make the dependencies
119 depend dep: $(INCS) $(OBJS:.o=.c)
120 @echo "Creating dependency information"
121 $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
123 # -----------------------------------------------------------------------------
124 # Rules to make config includes
126 apple2.inc: cfg/apple2.cfg
127 @$(CVT) $< $@ CfgApple2
129 apple2enh.inc: cfg/apple2enh.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