X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fda65%2Fmake%2Fgcc.mak;h=35e2805c7723a6048662513a9dab1960c7c978e0;hb=823d0b763663d2148ef8fbf6c680607cd8be8b74;hp=d0502f70bba749287be89746a9c8ccc08e456b8b;hpb=5a90b5a58cfefaa2fbc7d72101bdb2bb1cf970be;p=cc65 diff --git a/src/da65/make/gcc.mak b/src/da65/make/gcc.mak index d0502f70b..35e2805c7 100644 --- a/src/da65/make/gcc.mak +++ b/src/da65/make/gcc.mak @@ -2,48 +2,64 @@ # gcc Makefile for da65 # +# ------------------------------------------------------------------------------ + +# The executable to build +EXE = da65 + # Library dir COMMON = ../common -CFLAGS = -g -O2 -Wall -I$(COMMON) +CFLAGS = -g -O2 -Wall -W -std=c89 -I$(COMMON) CC=gcc +EBIND=emxbind LDFLAGS= -OBJS = attrtab.o \ - code.o \ - cpu.o \ - error.o \ - global.o \ +OBJS = asminc.o \ + attrtab.o \ + code.o \ + comments.o \ + data.o \ + error.o \ + global.o \ handler.o \ - main.o \ + infofile.o \ + labels.o \ + main.o \ + opc6502.o \ + opc65816.o \ + opc65c02.o \ + opc65sc02.o \ opctable.o \ - output.o + output.o \ + scanner.o \ + segment.o LIBS = $(COMMON)/common.a -EXECS = da65 +# ------------------------------------------------------------------------------ +# Makefile targets +# Main target - must be first .PHONY: all ifeq (.depend,$(wildcard .depend)) -all : $(EXECS) +all: $(EXE) include .depend else all: depend - @$(MAKE) -f make/gcc.mak all + @$(MAKE) -f make/gcc.mak all endif - - -da65: $(OBJS) $(LIBS) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) +$(EXE): $(OBJS) $(LIBS) + $(CC) $^ $(LDFLAGS) -o $@ + @if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi clean: - rm -f *~ core *.map + $(RM) *~ core.* *.map zap: clean - rm -f *.o $(EXECS) .depend - + $(RM) *.o $(EXE) .depend # ------------------------------------------------------------------------------ # Make the dependencies @@ -51,6 +67,6 @@ zap: clean .PHONY: depend dep depend dep: $(OBJS:.o=.c) @echo "Creating dependency information" - $(CC) -I$(COMMON) -MM $^ > .depend + $(CC) $(CFLAGS) -MM $^ > .depend