2 # Makefile for cross-compiler version of CC65.
8 # ------------------------------------------------------------------------------
10 # The executable to build
16 # The compiler include search path. Default is "/usr/lib/cc65/include/" if
17 # nothing is defined. You may use CC65_INC=foo on the command line to override it.
18 CC65_INC = \"/usr/lib/cc65/include/\"
22 CFLAGS = -O2 -g -Wall -W -std=c89
23 override CFLAGS += -I$(COMMON)
24 override CFLAGS += -DCC65_INC=$(CC65_INC)
28 # Determine the svn version number if possible
29 ifneq "$(shell which svnversion 2>/dev/null)" ""
30 SVNVERSION=$(shell svnversion)
31 ifeq "$(SVNVERSION)" "exported"
34 ifeq "$(SVNVERSION)" "Unversioned directory"
41 # ------------------------------------------------------------------------------
42 # Object files and libraries to link
115 LIBS = $(COMMON)/common.a
118 # ------------------------------------------------------------------------------
121 # Main target - must be first
123 ifeq (.depend,$(wildcard .depend))
124 all: svnversion $(EXE)
128 @$(MAKE) -f make/gcc.mak all
131 $(EXE): $(OBJS) $(LIBS)
132 $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -lm -o $@
133 @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
138 @echo "/* This file is auto-generated - do not modify! */" >> svnversion.c
139 @echo "" >> svnversion.c
140 @echo "const char SVNVersion[] = \"$(SVNVERSION)\";" >> svnversion.c
142 svnversion.c: svnversion
145 $(RM) *~ core.* *.map
148 $(RM) $(OBJS) $(EXE) .depend svnversion.c
150 # ------------------------------------------------------------------------------
151 # Make the dependencies
154 depend dep: $(OBJS:.o=.c)
155 @echo "Creating dependency information"
156 $(CC) -I$(COMMON) -MM $^ > .depend