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
71 # -----------------------------------------------------------------------------
72 # List of all macro files
80 LIBS = $(COMMON)/common.a
82 # ------------------------------------------------------------------------------
85 # Main target - must be first
87 ifeq (.depend,$(wildcard .depend))
92 @$(MAKE) -f make/gcc.mak all
95 $(EXE): $(INCS) $(OBJS) $(LIBS)
96 $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
97 @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
102 $(RM) *~ core.* *.map
105 $(RM) *.o $(EXE) $(INCS) .depend
107 # ------------------------------------------------------------------------------
108 # Make the dependencies
111 depend dep: $(INCS) $(OBJS:.o=.c)
112 @echo "Creating dependency information"
113 $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
115 # -----------------------------------------------------------------------------
116 # Rules to make config includes
118 atari.inc: macpack/atari.mac
119 @$(CVT) $< $@ MacAtari
121 cbm.inc: macpack/cbm.mac
124 cpu.inc: macpack/cpu.mac
127 generic.inc: macpack/generic.mac
128 @$(CVT) $< $@ MacGeneric
130 longbranch.inc: macpack/longbranch.mac
131 @$(CVT) $< $@ MacLongBranch