2 # Makefile for the cl65 compile&link utility
5 # ------------------------------------------------------------------------------
7 # The executable to build
13 # Type of spawn function to use
21 CFLAGS = -O2 -g -Wall -W -std=c89
22 override CFLAGS += -I$(COMMON)
23 override CFLAGS += -D$(SPAWN)
31 LIBS = $(COMMON)/common.a
33 # ------------------------------------------------------------------------------
36 # Main target - must be first
38 ifeq (.depend,$(wildcard .depend))
43 @$(MAKE) -f make/gcc.mak all
46 $(EXE): $(OBJS) $(LIBS)
47 $(CC) $^ $(LDFLAGS) -o $@
48 @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
54 $(RM) *.o $(EXE) .depend
56 # ------------------------------------------------------------------------------
57 # Make the dependencies
60 depend dep: $(OBJS:.o=.c)
61 @echo "Creating dependency information"
62 $(CC) $(CFLAGS) -D$(SPAWN) -MM $^ > .depend