2 # gcc Makefile for ca65
5 # ------------------------------------------------------------------------------
7 # The executable to build
13 # Several search paths. You may redefine these on the command line
14 CA65_INC = \"/usr/lib/cc65/asminc/\"
18 CFLAGS = -g -O2 -Wall -W -std=c89
19 override CFLAGS += -I$(COMMON)
20 override CFLAGS += -DCA65_INC=$(CA65_INC)
24 # Perl script for macro file conversion
25 CVT=macpack/cvt-mac.pl
27 # -----------------------------------------------------------------------------
28 # List of all object files
72 # -----------------------------------------------------------------------------
73 # List of all macro files
81 LIBS = $(COMMON)/common.a
83 # ------------------------------------------------------------------------------
86 # Main target - must be first
88 ifeq (.depend,$(wildcard .depend))
93 @$(MAKE) -f make/gcc.mak all
96 $(EXE): $(INCS) $(OBJS) $(LIBS)
97 $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
98 @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
103 $(RM) *~ core.* *.map
106 $(RM) *.o $(EXE) $(INCS) .depend
108 # ------------------------------------------------------------------------------
109 # Make the dependencies
112 depend dep: $(INCS) $(OBJS:.o=.c)
113 @echo "Creating dependency information"
114 $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
116 # -----------------------------------------------------------------------------
117 # Rules to make config includes
119 atari.inc: macpack/atari.mac
120 @$(CVT) $< $@ MacAtari
122 cbm.inc: macpack/cbm.mac
125 cpu.inc: macpack/cpu.mac
128 generic.inc: macpack/generic.mac
129 @$(CVT) $< $@ MacGeneric
131 longbranch.inc: macpack/longbranch.mac
132 @$(CVT) $< $@ MacLongBranch