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=<target>" in samples recursively work for all supported targets.
This commit is contained in:
mrdudz
2021-05-15 19:48:19 +02:00
parent 18ae09f682
commit 86bd6b9add
4 changed files with 234 additions and 30 deletions

View File

@@ -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

View File

@@ -1,4 +1,8 @@
# Run 'make SYS=<target>'; 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)