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:
4
.github/workflows/push.yaml
vendored
4
.github/workflows/push.yaml
vendored
@@ -7,10 +7,10 @@ jobs:
|
||||
name: Build gbdk project
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Build
|
||||
uses: wujood/gbdk-2020-github-builder@1.0.7
|
||||
uses: wujood/gbdk-2020-github-builder@1.0.8
|
||||
with:
|
||||
subdirectory: ./src
|
||||
output-name: gb-snake
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -24,3 +24,4 @@
|
||||
|
||||
gen/
|
||||
obj/
|
||||
dist/
|
||||
|
||||
7
.vscode/tasks.json
vendored
7
.vscode/tasks.json
vendored
@@ -19,6 +19,13 @@
|
||||
"showReuseMessage": true,
|
||||
"clear": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "run Emulicious mit snake.gb",
|
||||
"type": "shell",
|
||||
"command": "java -jar ~/SDK/Emulicious/Emulicious.jar dist/snake.gb",
|
||||
"group": "test",
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
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