From f4acd3eb4f13f5dee630b7506722829d4b24aac7 Mon Sep 17 00:00:00 2001 From: uz Date: Mon, 19 Oct 2009 18:02:40 +0000 Subject: [PATCH] Added a makefile for cc65 for testing purposes. git-svn-id: svn://svn.cc65.org/cc65/trunk@4379 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/common/make/cc65.mak | 104 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 src/common/make/cc65.mak diff --git a/src/common/make/cc65.mak b/src/common/make/cc65.mak new file mode 100644 index 000000000..8b9fddc82 --- /dev/null +++ b/src/common/make/cc65.mak @@ -0,0 +1,104 @@ +# +# cc65 Makefile for the cc65 common directory +# + + +RM = rm -f +SYS = c64 +CFLAGS = -g -T -t $(SYS) -Oirs --standard c89 +AS = ../ca65/ca65 +AR = ../ar65/ar65 +CC = ../cc65/cc65 +LDFLAGS = +LIB = common.lib + + + +# -------------------------------------------------------------------------- +# Generic rules + +.c.o: + @echo $< + @$(CC) $(CFLAGS) $< + @$(AS) $(basename $<).s + +.s.o: + @echo $< + @$(AS) $(MY_ASM) -t $(SYS) $< + +.o: + @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^ $(CLIB) + + +# -------------------------------------------------------------------------- +# Object files for the library + +OBJS = abend.o \ + addrsize.o \ + assertion.o \ + bitops.o \ + chartype.o \ + check.o \ + cmdline.o \ + coll.o \ + cpu.o \ + debugflag.o \ + exprdefs.o \ + filepos.o \ + filetype.o \ + fname.o \ + fp.o \ + hashstr.o \ + hashtab.o \ + intstack.o \ + matchpat.o \ + mmodel.o \ + print.o \ + searchpath.o \ + segdefs.o \ + segnames.o \ + shift.o \ + strbuf.o \ + strpool.o \ + strstack.o \ + strutil.o \ + target.o \ + tgttrans.o \ + version.o \ + xmalloc.o \ + xsprintf.o + + +# ------------------------------------------------------------------------------ +# Dummy targets + +.PHONY: all +ifeq (.depend,$(wildcard .depend)) +all: lib +include .depend +else +all: depend + @$(MAKE) -f make/gcc.mak all +endif + +.PHONY: lib +lib: $(LIB) + +$(LIB): $(OBJS) + $(AR) a $(LIB) $? + +clean: + $(RM) *~ core *.map + +zap: clean + $(RM) *.o $(LIB) .depend + +# ------------------------------------------------------------------------------ +# Make the dependencies + +.PHONY: depend dep +depend dep: $(OBJS:.o=.c) + @echo "Creating dependency information" + $(CC) $(CFLAGS) -MM $^ > .depend + + -- 2.39.5