Examples: fix some missing compile.bat

- Add missing target to some makefiles
- Fix megaduck and cross-platform folders not in list of folders to process
This commit is contained in:
bbbbbr
2025-11-26 23:33:38 -08:00
parent ab1cd3a802
commit 65f033ac5e
33 changed files with 162 additions and 4 deletions

View File

@@ -12,6 +12,8 @@ VER = 4.4.0
PORTS=sm83 z80 mos6502
PLATFORMS=gb ap duck gg sms msxdos nes
EXAMPLE_DIRS=$(PLATFORMS)
EXAMPLE_DIRS+= cross-platform megaduck
# Prefix to add to the standard tools. Usefull for a standard gcc
# cross-compile.
@@ -279,10 +281,10 @@ gbdk-lib-install-platforms:
gbdk-lib-install-examples:
@echo Installing Examples
@cp -r $(GBDKLIBDIR)/include $(GBDKLIBDIR)/examples $(BUILDDIR)
@for plat in $(PLATFORMS); do \
if [ -d "$(BUILDDIR)/examples/$$plat" ]; then \
echo Generating Examples compile.bat for $$plat; \
$(MAKE) -C $(BUILDDIR)/examples/$$plat compile.bat --no-print-directory; \
@for example_dir in $(EXAMPLE_DIRS); do \
if [ -d "$(BUILDDIR)/examples/$$example_dir" ]; then \
echo Generating Examples compile.bat for $$example_dir; \
$(MAKE) -C $(BUILDDIR)/examples/$$example_dir compile.bat --no-print-directory; \
echo; \
fi \
done

View File

@@ -50,6 +50,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(eval BOFLAG = $(shell echo "$<" | sed -n 's/.*\.bo\([0-9]\+\).*/\-Wf-bo\1/p'))

View File

@@ -52,6 +52,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -50,6 +50,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(eval BOFLAG = $(shell echo "$<" | sed -n 's/.*\.bo\([0-9]\+\).*/\-Wf-bo\1/p'))

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -47,6 +47,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -58,6 +58,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Use png2asset to convert the png into C formatted metasprite data
# -sh 48 : Sets sprite height to 48 (width remains automatic)
# -spr8x16 : Use 8x16 hardware sprites

View File

@@ -61,6 +61,11 @@ CFLAGS += -I$(OBJDIR)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Use png2asset to convert the png into C formatted map data
# -c ... : Set C output file
# Convert metasprite .pngs in res/ -> .c files in obj/<platform ext>/src/

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -47,6 +47,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -71,6 +71,11 @@ CFLAGS += -I$(OBJDIR)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Use png2asset to convert the png into C formatted map data
# -c ... : Set C output file
# Convert metasprite .pngs in res/ -> .c files in obj/<platform ext>/src/

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -59,6 +59,11 @@ OBJS = $(IMAGES:%.png=$(OBJDIR)/%.o) $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMS
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
.SECONDEXPANSION:
$(OBJDIR)/%.c: $(RESDIR)/%.png $$(wildcard $(RESDIR)/gfx/$(PLAT)/backgrounds/%.png.meta)
$(PNG2ASSETS) $< `cat <$<.meta 2>/dev/null` -c $@

View File

@@ -59,6 +59,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Use png2asset to convert the png into C formatted metasprite data
# -sh 48 : Sets sprite height to 48 (width remains automatic)
# -spr8x16 : Use 8x16 hardware sprites

View File

@@ -47,6 +47,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -56,6 +56,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -48,6 +48,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -59,6 +59,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Use png2asset to convert the png into C formatted metasprite data
# -sh 48 : Sets sprite height to 48 (width remains automatic)
# -spr8x16 : Use 8x16 hardware sprites

View File

@@ -50,6 +50,11 @@ OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -c -o $@ $<

View File

@@ -60,6 +60,11 @@ PNG2ASSET_BKG_SETTINGS_pocket=
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -I$(GENDIR) -c -o $@ $<

View File

@@ -62,6 +62,11 @@ PNG2ASSET_BKG_SETTINGS_pocket=
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -I$(GENDIR) -c -o $@ $<

View File

@@ -62,6 +62,11 @@ PNG2ASSET_BKG_SETTINGS_pocket=
# Builds all targets sequentially
all: $(TARGETS)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(LCC) $(LCCFLAGS) $(CFLAGS) -I$(GENDIR) -c -o $@ $<

View File

@@ -60,6 +60,10 @@ all: $(TARGETS)
test:
echo $(CSOURCES)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | sed s/mkdir\ -p\/mkdir\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c

View File

@@ -60,6 +60,10 @@ all: $(TARGETS)
test:
echo $(CSOURCES)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | sed s/mkdir\ -p\/mkdir\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c

View File

@@ -60,6 +60,10 @@ all: $(TARGETS)
test:
echo $(CSOURCES)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | sed s/mkdir\ -p\/mkdir\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c

View File

@@ -60,6 +60,10 @@ all: $(TARGETS)
test:
echo $(CSOURCES)
compile.bat: Makefile
@echo "REM Automatically generated from Makefile" > compile.bat
@make -sn | sed y/\\//\\\\/ | sed s/mkdir\ -p\/mkdir\/ | grep -v make >> compile.bat
# Compile .c files in "src/" to .o object files
$(OBJDIR)/%.o: $(SRCDIR)/%.c