mirror of
https://github.com/mars3142/gb-snake.git
synced 2026-03-12 19:49:05 +00:00
some build tools optimization
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
19
Makefile
19
Makefile
@@ -16,7 +16,6 @@ PNG2ASSET = $(GBDK_HOME)bin/png2asset
|
||||
# LCCFLAGS += -v # Uncomment for lcc verbose output
|
||||
LCCFLAGS +=-Wa-l -Wl-m -Wl-j -Wf--debug
|
||||
|
||||
|
||||
# You can set the name of the .gb ROM file here
|
||||
PROJECTNAME = snake
|
||||
|
||||
@@ -30,7 +29,7 @@ CSOURCES = $(foreach dir,$(SRCDIR),$(notdir $(wildcard $(dir)/*.c))) $(foreac
|
||||
ASMSOURCES = $(foreach dir,$(SRCDIR),$(notdir $(wildcard $(dir)/*.s)))
|
||||
OBJS = $(CSOURCES:%.c=$(OBJDIR)/%.o) $(ASMSOURCES:%.s=$(OBJDIR)/%.o)
|
||||
|
||||
all: clean prepare png2asset $(BINS)
|
||||
all: clean prepare png2asset $(BINS)
|
||||
|
||||
compile.bat: Makefile
|
||||
@echo "REM Automatically generated from Makefile" > compile.bat
|
||||
@@ -56,10 +55,22 @@ $(OBJDIR)/%.s: $(SRCDIR)/%.c
|
||||
# Link the compiled object files into a .gb ROM file
|
||||
$(BINS): $(OBJS)
|
||||
$(LCC) $(LCCFLAGS) -o $(BINS) $(OBJS)
|
||||
mv $(BINS) $(DSTDIR)
|
||||
|
||||
png2asset:
|
||||
${PNG2ASSET} ${RESDIR}/splash_screen.png -c ${GENDIR}/splash_screen.c -map -source_tileset $(RESDIR)/splash_screen_tileset.png -noflip
|
||||
${PNG2ASSET} ${RESDIR}/splash_screen_tileset.png -c ${GENDIR}/splash_screen_tileset.c -tiles_only -map -noflip
|
||||
@for f in $(RESDIR)/*.png; do \
|
||||
name=`basename "$$f" .png`; \
|
||||
if echo "$$name" | grep -q '_tileset$$'; then \
|
||||
${PNG2ASSET} "$$f" -c ${GENDIR}/"$$name".c -tiles_only -map -noflip; \
|
||||
else \
|
||||
tileset="$(RESDIR)/$${name}_tileset.png"; \
|
||||
if [ -f "$$tileset" ]; then \
|
||||
${PNG2ASSET} "$$f" -c ${GENDIR}/"$$name".c -source_tileset "$$tileset" -map -noflip; \
|
||||
else \
|
||||
${PNG2ASSET} "$$f" -c ${GENDIR}/"$$name".c -map -noflip; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
prepare:
|
||||
mkdir -p $(DSTDIR)
|
||||
|
||||
Reference in New Issue
Block a user