2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
# Run 'make SYS=<target>'; or, set a SYS env.
|
|
|
|
# var. to build for another target system.
|
|
|
|
SYS ?= geos-cbm
|
|
|
|
|
2021-05-16 16:23:23 +00:00
|
|
|
# If SYS was given on the commandline, redirect "c64" to "geos-cbm" and
|
|
|
|
# "apple2enh" to "geos-apple"
|
2021-05-16 20:24:35 +00:00
|
|
|
ifeq ($(origin SYS),command line)
|
|
|
|
ifeq ($(SYS),c64)
|
|
|
|
override SYS = geos-cbm
|
|
|
|
$(info GEOS: c64 -> geos-cbm)
|
|
|
|
endif
|
|
|
|
ifeq ($(SYS),apple2enh)
|
|
|
|
override SYS = geos-apple
|
|
|
|
$(info GEOS: apple2enh -> geos-apple)
|
|
|
|
endif
|
2021-05-16 16:23:23 +00:00
|
|
|
endif
|
|
|
|
|
2020-08-27 12:25:33 +00:00
|
|
|
# Just the usual way to find out if we're
|
|
|
|
# using cmd.exe to execute make rules.
|
|
|
|
ifneq ($(shell echo),)
|
|
|
|
CMD_EXE = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CMD_EXE
|
|
|
|
NULLDEV = nul:
|
|
|
|
DEL = -del /f
|
|
|
|
RMDIR = rmdir /s /q
|
|
|
|
else
|
|
|
|
NULLDEV = /dev/null
|
|
|
|
DEL = $(RM)
|
|
|
|
RMDIR = $(RM) -r
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef CC65_HOME
|
|
|
|
AS = $(CC65_HOME)/bin/ca65
|
|
|
|
CC = $(CC65_HOME)/bin/cc65
|
|
|
|
CL = $(CC65_HOME)/bin/cl65
|
|
|
|
LD = $(CC65_HOME)/bin/ld65
|
|
|
|
SP = $(CC65_HOME)/bin/sp65
|
|
|
|
else
|
2020-10-15 16:35:54 +00:00
|
|
|
AS := $(if $(wildcard ../../bin/ca65*),../../bin/ca65,ca65)
|
|
|
|
CC := $(if $(wildcard ../../bin/cc65*),../../bin/cc65,cc65)
|
|
|
|
CL := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
|
|
|
|
LD := $(if $(wildcard ../../bin/ld65*),../../bin/ld65,ld65)
|
|
|
|
SP := $(if $(wildcard ../../bin/sp65*),../../bin/sp65,sp65)
|
2022-04-18 15:43:56 +00:00
|
|
|
endif
|
2020-08-27 12:25:33 +00:00
|
|
|
|
2020-10-15 16:41:17 +00:00
|
|
|
DIRLIST = grc
|
|
|
|
|
|
|
|
define SUBDIR_recipe
|
|
|
|
|
2022-02-07 19:09:27 +00:00
|
|
|
@+$(MAKE) SYS=$(SYS) -C $(dir) --no-print-directory $@
|
2020-10-15 16:41:17 +00:00
|
|
|
|
|
|
|
endef # SUBDIR_recipe
|
|
|
|
|
2021-05-15 17:48:19 +00:00
|
|
|
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
|
2020-08-27 12:25:33 +00:00
|
|
|
|
2021-05-15 17:48:19 +00:00
|
|
|
# omitted: dialog.c grphstr.c inittab.c menu.c
|
2020-08-27 12:25:33 +00:00
|
|
|
# TODO: geosconio.cvt rmvprot.cvt
|
2021-05-15 17:48:19 +00:00
|
|
|
|
|
|
|
ifneq ($(EXELIST_$(SYS)),)
|
|
|
|
samples: $(EXELIST_$(SYS))
|
2020-10-15 16:41:17 +00:00
|
|
|
$(foreach dir,$(DIRLIST),$(SUBDIR_recipe))
|
2023-01-14 12:49:16 +00:00
|
|
|
|
|
|
|
define samples-geos
|
|
|
|
c1541 -attach $(0).d64 -geoswrite $(1);
|
|
|
|
endef
|
|
|
|
|
|
|
|
samples-geos: $(EXELIST_$(SYS))
|
|
|
|
c1541 -format "$@,01" d64 $@.d64
|
|
|
|
$(foreach tool,$(EXELIST_$(SYS)),$(call samples-geos,$(tool)))
|
2021-05-15 17:48:19 +00:00
|
|
|
else
|
|
|
|
samples:
|
2021-05-16 20:24:35 +00:00
|
|
|
ifeq ($(MAKELEVEL),0)
|
|
|
|
@echo "info: geos samples not available for" $(SYS)
|
2021-05-16 21:38:17 +00:00
|
|
|
else
|
|
|
|
# suppress the "nothing to be done for 'samples' message
|
|
|
|
@echo > $(NULLDEV)
|
2021-05-16 20:24:35 +00:00
|
|
|
endif
|
2021-05-15 17:48:19 +00:00
|
|
|
endif
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
bitmap.c: logo.pcx
|
|
|
|
$(SP) -r logo.pcx -c geos-bitmap -w bitmap.c,ident=bitmap
|
|
|
|
|
|
|
|
bitmap-demo.cvt: bitmap.c bitmap-demores.grc bitmap-demo.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m bitmap-demo.map bitmap-demores.grc bitmap-demo.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
filesel.cvt: fileselres.grc filesel.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m filesel.map fileselres.grc filesel.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
geosconio.cvt: geosconiores.grc geosconio.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m geosconio.map geosconiores.grc geosconio.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
geosver.cvt: geosverres.grc geosver.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m geosver.map geosverres.grc geosver.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
getid.cvt: getidres.grc getid.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m getid.map getidres.grc getid.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
hello1.cvt: hello1res.grc hello1.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m hello1.map hello1res.grc hello1.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
hello2.cvt: hello2res.grc hello2.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m hello2.map hello2res.grc hello2.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
overlay-demo.cvt: overlay-demores.grc overlay-demo.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m overlay-demo.map overlay-demores.grc overlay-demo.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
rmvprot.cvt: rmvprotres.grc rmvprot.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m rmvprot.map rmvprotres.grc rmvprot.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
vector-demo.cvt: vector-demores.grc vector-demo.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m vector-demo.map vector-demores.grc vector-demo.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
yesno.cvt: yesnores.grc yesno.c
|
2023-01-08 16:47:04 +00:00
|
|
|
$(CL) -t $(SYS) -O -o $@ -m yesno.map yesnores.grc yesno.c
|
2020-08-27 12:25:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
clean:
|
2020-10-15 17:34:40 +00:00
|
|
|
@$(DEL) overlay-demores.h 2>$(NULLDEV)
|
|
|
|
@$(DEL) bitmap.c 2>$(NULLDEV)
|
|
|
|
@$(DEL) *.cvt 2>$(NULLDEV)
|
|
|
|
@$(DEL) *.map 2>$(NULLDEV)
|
2020-10-15 16:41:17 +00:00
|
|
|
$(foreach dir,$(DIRLIST),$(SUBDIR_recipe))
|