mirror of
https://github.com/cc65/cc65.git
synced 2024-12-27 00:29:31 +00:00
ce487651b0
- only output messages if MAKELEVEL is 0 - indent nested ifeq - use if (,) syntax
134 lines
3.4 KiB
Makefile
134 lines
3.4 KiB
Makefile
|
|
# Run 'make SYS=<target>'; or, set a SYS env.
|
|
# var. to build for another target system.
|
|
SYS ?= geos-cbm
|
|
|
|
# If SYS was given on the commandline, redirect "c64" to "geos-cbm" and
|
|
# "apple2enh" to "geos-apple"
|
|
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
|
|
endif
|
|
|
|
# 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
|
|
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)
|
|
endif
|
|
|
|
DIRLIST = grc
|
|
|
|
define SUBDIR_recipe
|
|
|
|
@$(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
|
|
|
|
ifneq ($(EXELIST_$(SYS)),)
|
|
samples: $(EXELIST_$(SYS))
|
|
$(foreach dir,$(DIRLIST),$(SUBDIR_recipe))
|
|
else
|
|
samples:
|
|
ifeq ($(MAKELEVEL),0)
|
|
@echo "info: geos samples not available for" $(SYS)
|
|
endif
|
|
endif
|
|
|
|
|
|
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
|
|
$(CL) -t $(SYS) -O -o bitmap-demo.cvt -m bitmap-demo.map bitmap-demores.grc bitmap-demo.c
|
|
|
|
filesel.cvt: fileselres.grc filesel.c
|
|
$(CL) -t $(SYS) -O -o filesel.cvt -m filesel.map fileselres.grc filesel.c
|
|
|
|
geosconio.cvt: geosconiores.grc geosconio.c
|
|
$(CL) -t $(SYS) -O -o geosconio.cvt -m geosconio.map geosconiores.grc geosconio.c
|
|
|
|
geosver.cvt: geosverres.grc geosver.c
|
|
$(CL) -t $(SYS) -O -o geover.cvt -m geosver.map geosverres.grc geosver.c
|
|
|
|
getid.cvt: getidres.grc getid.c
|
|
$(CL) -t $(SYS) -O -o getid.cvt -m getid.map getidres.grc getid.c
|
|
|
|
hello1.cvt: hello1res.grc hello1.c
|
|
$(CL) -t $(SYS) -O -o hello1.cvt -m hello1.map hello1res.grc hello1.c
|
|
|
|
hello2.cvt: hello2res.grc hello2.c
|
|
$(CL) -t $(SYS) -O -o hello2.cvt -m hello2.map hello2res.grc hello2.c
|
|
|
|
overlay-demo.cvt: overlay-demores.grc overlay-demo.c
|
|
$(CL) -t $(SYS) -O -o overlay-demo.cvt -m overlay-demo.map overlay-demores.grc overlay-demo.c
|
|
|
|
rmvprot.cvt: rmvprotres.grc rmvprot.c
|
|
$(CL) -t $(SYS) -O -o rmvprot.cvt -m rmvprot.map rmvprotres.grc rmvprot.c
|
|
|
|
vector-demo.cvt: vector-demores.grc vector-demo.c
|
|
$(CL) -t $(SYS) -O -o vector-demo.cvt -m vector-demo.map vector-demores.grc vector-demo.c
|
|
|
|
yesno.cvt: yesnores.grc yesno.c
|
|
$(CL) -t $(SYS) -O -o yesno.cvt -m yesno.map yesnores.grc yesno.c
|
|
|
|
|
|
clean:
|
|
@$(DEL) overlay-demores.h 2>$(NULLDEV)
|
|
@$(DEL) bitmap.c 2>$(NULLDEV)
|
|
@$(DEL) *.cvt 2>$(NULLDEV)
|
|
@$(DEL) *.map 2>$(NULLDEV)
|
|
$(foreach dir,$(DIRLIST),$(SUBDIR_recipe))
|