From 9d5d94196f17d3653427279a324d9f55f7d4bed1 Mon Sep 17 00:00:00 2001 From: "ol.sc" Date: Thu, 3 Jun 2010 16:47:15 +0000 Subject: [PATCH] Adjusted Makefile and remarks to the recent cc65 improvements. git-svn-id: svn://svn.cc65.org/cc65/trunk@4683 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- doc/make.sgml | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/doc/make.sgml b/doc/make.sgml index 078d7e97c..5affe3b9f 100644 --- a/doc/make.sgml +++ b/doc/make.sgml @@ -59,7 +59,7 @@ PROGRAM = foobar ifdef CC65_TARGET CC = $(CC65_HOME)/bin/cl65 -CFLAGS = -t $(CC65_TARGET) --create-dep -O +CFLAGS = -t $(CC65_TARGET) --create-dep $(<:.c=.d) -O LDFLAGS = -t $(CC65_TARGET) -m $(PROGRAM).map else CC = gcc @@ -69,35 +69,27 @@ endif ######################################## -ifdef CC65_TARGET -define MAKEDEPEND -sed -e"s!.s:!.o:!p" -e"s![^\t]*\t\(.*\)!\1:!" < $(<:.c=.u) > $(@:.o=.d) -rm -f $(<:.c=.u) -endef -endif - .SUFFIXES: -.PHONY: all +.PHONY: all clean all: $(PROGRAM) ifneq ($(MAKECMDGOALS),clean) -include $(SOURCES:.c=.d) endif -clean: - rm -f $(SOURCES:.c=.o) $(SOURCES:.c=.d) $(PROGRAM) $(PROGRAM).map - %.o: %.c - $(CC) -c $(CFLAGS) $< -o $@ - @$(MAKEDEPEND) + $(CC) -c $(CFLAGS) -o $@ $< $(PROGRAM): $(SOURCES:.c=.o) - $(CC) $(LDFLAGS) $^ -o $@ + $(CC) $(LDFLAGS) -o $@ $^ + +clean: + $(RM) $(SOURCES:.c=.o) $(SOURCES:.c=.d) $(PROGRAM) $(PROGRAM).map Invoking the sample Makefile

@@ -112,11 +104,11 @@ best done on the GNU Make command line like this: make CC65_TARGET=c64 -The sample Makefile doesn't require cc65 to be "installed" in any way. Rather it -only presumes the single variable Understanding the sample Makefile

@@ -126,15 +118,7 @@ Most parts of the sample Makefile follow the guidelines in the that can be searched online for background information. The automatic generation of dependency however rather works as described by the GNU Make maintainer Paul D. Smith in . - -In the meantime GCC supports this method directly with the preprocessor option - -foo.o: foo.c foo.h bar.h -foo.c foo.h bar.h: - +Fortunately both GCC and cc65 directly support this method in the meantime. Invoking the sample Makefile on Windows

@@ -150,7 +134,6 @@ by downloading the following programs: make.exe: -sed.exe: rm.exe: