From 86bd6b9addc7650560826e3c21c7b393567d3cc0 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sat, 15 May 2021 19:48:19 +0200 Subject: [PATCH] Added executable list for all targets and print a message when certain samples are not available for a target (instead of failing). This makes "make SYS=" in samples recursively work for all supported targets. --- samples/Makefile | 152 ++++++++++++++++++++++++++++++++++---- samples/geos/Makefile | 35 +++++++-- samples/geos/grc/Makefile | 29 ++++++-- samples/tutorial/Makefile | 48 +++++++++++- 4 files changed, 234 insertions(+), 30 deletions(-) diff --git a/samples/Makefile b/samples/Makefile index 6e89cb802..e8b9824d8 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -159,21 +159,6 @@ DIRLIST = tutorial geos # -------------------------------------------------------------------------- # Lists of executables -EXELIST_c64 = \ - ascii \ - enumdevdir \ - fire \ - gunzip65 \ - hello \ - mandelbrot \ - mousedemo \ - multdemo \ - nachtm \ - ovrldemo \ - plasma \ - sieve \ - tgidemo - EXELIST_apple2 = \ ascii \ diodemo \ @@ -204,10 +189,141 @@ EXELIST_atarixl = $(EXELIST_atari) EXELIST_atari2600 = \ atari2600hello - + +EXELIST_atmos = \ + ascii \ + hello \ + mandelbrot \ + sieve + +EXELIST_bbc = \ + notavailable + +EXELIST_c64 = \ + ascii \ + enumdevdir \ + fire \ + gunzip65 \ + hello \ + mandelbrot \ + mousedemo \ + multdemo \ + nachtm \ + ovrldemo \ + plasma \ + sieve \ + tgidemo + +EXELIST_c128 = \ + ascii \ + enumdevdir \ + fire \ + gunzip65 \ + hello \ + mandelbrot \ + mousedemo \ + nachtm \ + plasma \ + sieve \ + tgidemo + +EXELIST_c16 = \ + ascii \ + enumdevdir \ + hello + +EXELIST_cbm510 = \ + ascii \ + fire \ + gunzip65 \ + hello \ + mousedemo \ + nachtm \ + plasma \ + sieve + +EXELIST_cbm610 = \ + ascii \ + gunzip65 \ + hello \ + nachtm \ + sieve + +EXELIST_creativision = \ + ascii \ + hello + +EXELIST_cx16 = \ + ascii \ + enumdevdir \ + gunzip65 \ + hello \ + mandelbrot \ + mousedemo \ + sieve \ + tgidemo + +EXELIST_gamate = \ + hello + +EXELIST_geos-cbm = \ + ascii \ + diodemo + +EXELIST_geos-apple = \ + ascii \ + diodemo + +EXELIST_lunix = \ + notavailable + +EXELIST_lynx = \ + notavailable + +EXELIST_nes = \ + hello + +EXELIST_osic1p = \ + notavailable + +EXELIST_pce = \ + hello + +EXELIST_pet = \ + ascii \ + enumdevdir \ + hello \ + sieve + +EXELIST_plus4 = \ + ascii \ + enumdevdir \ + gunzip65 \ + hello \ + plasma \ + sieve + +EXELIST_sim6502 = \ + gunzip65 + +EXELIST_sim65c02 = $(EXELIST_sim6502) + EXELIST_supervision = \ supervisionhello +EXELIST_telestrat = \ + ascii \ + gunzip65 \ + hello + +EXELIST_vic20 = \ + ascii \ + enumdevdir \ + hello \ + mandelbrot \ + sieve \ + tgidemo + # Unlisted targets will try to build everything. # That lets us learn what they cannot build, and what settings # we need to use for programs that can be built and run. @@ -227,6 +343,10 @@ endef # SUBDIR_recipe samples: $(EXELIST_$(SYS)) $(foreach dir,$(DIRLIST),$(SUBDIR_recipe)) +# empty target used to skip systems that will not work with any program in this dir +notavailable: + @echo "warning: generic samples not available for" $(SYS) + disk: $(DISK_$(SYS)) all: diff --git a/samples/geos/Makefile b/samples/geos/Makefile index 00841ee8f..9ad555565 100644 --- a/samples/geos/Makefile +++ b/samples/geos/Makefile @@ -37,17 +37,42 @@ DIRLIST = grc define SUBDIR_recipe -@$(MAKE) -C $(dir) --no-print-directory $@ +@$(MAKE) SYS=$(SYS) -C $(dir) --no-print-directory $@ endef # SUBDIR_recipe +EXELIST_geos-cbm = \ + bitmap-demo.cvt \ + filesel.cvt \ + geosver.cvt \ + getid.cvt \ + hello1.cvt \ + hello2.cvt \ + overlay-demo.cvt \ + vector-demo.cvt \ + yesno.cvt + +EXELIST_geos-apple = \ + bitmap-demo.cvt \ + filesel.cvt \ + hello1.cvt \ + hello2.cvt \ + overlay-demo.cvt \ + vector-demo.cvt \ + yesno.cvt + # omitted: dialog.c grphstr.c inittab.c menu.c - # TODO: geosconio.cvt rmvprot.cvt -samples: bitmap-demo.cvt filesel.cvt geosver.cvt getid.cvt hello1.cvt hello2.cvt \ - overlay-demo.cvt vector-demo.cvt yesno.cvt - $(foreach dir,$(DIRLIST),$(SUBDIR_recipe)) +ifneq ($(EXELIST_$(SYS)),) +samples: $(EXELIST_$(SYS)) + $(foreach dir,$(DIRLIST),$(SUBDIR_recipe)) +else +samples: + @echo "warning: geos samples not available for" $(SYS) +endif + + bitmap.c: logo.pcx $(SP) -r logo.pcx -c geos-bitmap -w bitmap.c,ident=bitmap diff --git a/samples/geos/grc/Makefile b/samples/geos/grc/Makefile index 81f9ca045..0a432fd89 100644 --- a/samples/geos/grc/Makefile +++ b/samples/geos/grc/Makefile @@ -1,4 +1,8 @@ +# Run 'make SYS='; or, set a SYS env. +# var. to build for another target system. +SYS ?= geos-cbm + # Just the usual way to find out if we're # using cmd.exe to execute make rules. ifneq ($(shell echo),) @@ -29,22 +33,31 @@ else GRC := $(if $(wildcard ../../../bin/grc65*),../../../bin/grc65,grc65) endif -samples: test.s vlir.cvt +EXELIST_geos-cbm = \ + test.s \ + vlir.cvt + +ifneq ($(EXELIST_$(SYS)),) +samples: $(EXELIST_$(SYS)) +else +samples: + @echo "warning: grc sample not available for" $(SYS) +endif test.s: test.grc $(GRC) -s test.s test.grc vlir.cvt: vlir.grc vlir0.s vlir1.s vlir2.s # using seperate calls here for demonstration purposes: - $(GRC) -t geos-cbm -s vlir.s vlir.grc - $(AS) -t geos-cbm vlir.s - $(AS) -t geos-cbm vlir0.s - $(AS) -t geos-cbm vlir1.s - $(AS) -t geos-cbm vlir2.s - $(LD) -t geos-cbm -o vlir.cvt vlir.o vlir0.o vlir1.o vlir2.o geos-cbm.lib + $(GRC) -t $(SYS) -s vlir.s vlir.grc + $(AS) -t $(SYS) vlir.s + $(AS) -t $(SYS) vlir0.s + $(AS) -t $(SYS) vlir1.s + $(AS) -t $(SYS) vlir2.s + $(LD) -t $(SYS) -o vlir.cvt vlir.o vlir0.o vlir1.o vlir2.o $(SYS).lib # you can also do the above in one command: -# $(CL) -t geos-cbm -o vlir.cvt vlir.grc vlir0.s vlir1.s vlir2.s +# $(CL) -t $(SYS) -o vlir.cvt vlir.grc vlir0.s vlir1.s vlir2.s clean: @$(DEL) test.s test.h 2>$(NULLDEV) diff --git a/samples/tutorial/Makefile b/samples/tutorial/Makefile index 2c4bcb988..39b2d6e8c 100644 --- a/samples/tutorial/Makefile +++ b/samples/tutorial/Makefile @@ -31,10 +31,56 @@ else LD := $(if $(wildcard ../../bin/ld65*),../../bin/ld65,ld65) endif -samples: hello +EXELIST_atari2600 = \ + notavailable + +EXELIST_bbc = \ + notavailable + +EXELIST_creativision = \ + notavailable + +EXELIST_gamate = \ + notavailable + +EXELIST_geos-cbm = \ + notavailable + +EXELIST_geos-apple = \ + notavailable + +EXELIST_lunix = \ + notavailable + +EXELIST_lynx = \ + notavailable + +EXELIST_nes = \ + notavailable + +EXELIST_osic1p = \ + notavailable + +EXELIST_pce = \ + notavailable + +EXELIST_supervision = \ + notavailable + +# Unlisted targets will try to build everything. +# That lets us learn what they cannot build, and what settings +# we need to use for programs that can be built and run. +ifndef EXELIST_$(SYS) +EXELIST_$(SYS) := ${patsubst %.c,%,$(wildcard *.c)} +endif + +samples: $(EXELIST_$(SYS)) hello: hello.c text.s $(CL) -t $(SYS) -o hello hello.c text.s +# empty target used to skip systems that will not work with any program in this dir +notavailable: + @echo "warning: tutorial sample not available for" $(SYS) clean: @$(DEL) hello 2>$(NULLDEV)