From d97a46c3974b5e21d17fce2f7621a454b6631eb2 Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Sat, 22 Mar 2014 12:04:16 +0100 Subject: [PATCH] Simplify to use less 'if's. Add missing link options for Atari TGI programs. Put '--start-addr' at beginning of ld65 command line. --- samples/Makefile | 80 +++++++++++++----------------------------------- 1 file changed, 22 insertions(+), 58 deletions(-) diff --git a/samples/Makefile b/samples/Makefile index a17288ced..5f3b8687e 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -43,6 +43,25 @@ endif # This one comes with VICE C1541 = c1541 +# -------------------------------------------------------------------------- +# System dependent settings + +# The Apple machines need the start address adjusted when using TGI +LDFLAGS_mandelbrot_apple2 = --start-addr 0x4000 +LDFLAGS_tgidemo_apple2 = --start-addr 0x4000 +LDFLAGS_mandelbrot_apple2enh = --start-addr 0x4000 +LDFLAGS_tgidemo_apple2enh = --start-addr 0x4000 + +# The Apple ][ needs the start address adjusted for the mousetest +LDFLAGS_mousetest_apple2 = --start-addr 0x4000 + +# The atarixl target needs the start address adjusted when using TGI +LDFLAGS_mandelbrot_atarixl = --start-addr 0x4000 +LDFLAGS_tgidemo_atarixl = --start-addr 0x4000 + +# The atari target needs to reserve some memory when using TGI +LDFLAGS_mandelbrot_atari = -D __RESERVED_MEMORY__=0x2000 +LDFLAGS_tgidemo_atari = -D __RESERVED_MEMORY__=0x2000 # -------------------------------------------------------------------------- # Generic rules @@ -59,9 +78,10 @@ C1541 = c1541 @echo $< @$(AS) $(AFLAGS) -t $(SYS) $< -.o: - @$(LD) -o $@ -t $(SYS) -m $@.map $^ $(CLIB) +.PRECIOUS: %.o +.o: + $(LD) $(LDFLAGS_$(basename $@)_$(SYS)) -o $@ -t $(SYS) -m $@.map $^ $(CLIB) # -------------------------------------------------------------------------- # List of executables. This list could be made target dependent by checking @@ -88,62 +108,6 @@ EXELIST = ascii \ .PHONY: all all: $(EXELIST) -ascii: ascii.o - -diodemo: diodemo.o - -fire: fire.o - -gunzip65: gunzip65.o - -hello: hello.o - -# The Apple machines need the start address adjusted for the mandelbrot demo -ifeq "$(SYS)" "apple2" -mandelbrot: mandelbrot.o - @$(LD) -o $@ -t $(SYS) -m $@.map --start-addr 0x4000 $^ $(CLIB) -else -ifeq "$(SYS)" "apple2enh" -mandelbrot: mandelbrot.o - @$(LD) -o $@ -t $(SYS) -m $@.map --start-addr 0x4000 $^ $(CLIB) -else -mandelbrot: mandelbrot.o -endif -endif - -# The Apple ][ needs the start address adjusted for the mousetest -ifeq "$(SYS)" "apple2" -mousetest: mousetest.o - @$(LD) -o $@ -t $(SYS) -m $@.map --start-addr 0x4000 $^ $(CLIB) -else -mousetest: mousetest.o -endif - -multdemo: multidemo.o - @$(LD) -o $@ -m $@.map -C $(SYS)-overlay.cfg $^ $(CLIB) - -nachtm: nachtm.o - -ovrldemo: overlaydemo.o - @$(LD) -o $@ -m $@.map -C $(SYS)-overlay.cfg $^ $(CLIB) - -plasma: plasma.o - -sieve: sieve.o - -# The Apple machines need the start address adjusted for the tgidemo -ifeq "$(SYS)" "apple2" -tgidemo: tgidemo.o - @$(LD) -o $@ -t $(SYS) -m $@.map --start-addr 0x4000 $^ $(CLIB) -else -ifeq "$(SYS)" "apple2enh" -tgidemo: tgidemo.o - @$(LD) -o $@ -t $(SYS) -m $@.map --start-addr 0x4000 $^ $(CLIB) -else -tgidemo: tgidemo.o -endif -endif - # -------------------------------------------------------------------------- # Rule to make a disk with all samples. Needs the c1541 program that comes # with the VICE emulator. -- 2.39.5