]> git.sur5r.net Git - cc65/commitdiff
Added a makefile for cc65 for testing purposes.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 19 Oct 2009 18:02:40 +0000 (18:02 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 19 Oct 2009 18:02:40 +0000 (18:02 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4379 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/common/make/cc65.mak [new file with mode: 0644]

diff --git a/src/common/make/cc65.mak b/src/common/make/cc65.mak
new file mode 100644 (file)
index 0000000..8b9fddc
--- /dev/null
@@ -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
+
+