1
0
mirror of https://github.com/UzixLS/pacemuzx.git synced 2025-07-18 23:01:36 +03:00

Build system improvements

- added 'make run' rule to help with testing
- preserved pasmo exit code on Win32 assembly failure
- fixed Win32 clean rule so it removes all files cleanly
- easier to change target basename
This commit is contained in:
Simon Owen
2013-06-03 22:32:49 +01:00
parent d004ed1a85
commit 9f75a8d527
4 changed files with 36 additions and 19 deletions

View File

@ -1,10 +1,11 @@
TAPE=pacemuzx.tap NAME=pacemuzx
ROMS=pacman.6e pacman.6f pacman.6h pacman.6j ROMS=pacman.6e pacman.6f pacman.6h pacman.6j
UNAME := $(shell uname -s)
.PHONY: dist clean .PHONY: dist clean
$(TAPE): loader.tap pacemuzx.o $(NAME).tap: loader.tap $(NAME).o
cat loader.tap pacemuzx.o > $@ cat loader.tap $(NAME).o > $@
tiles.bin: tiles.png tiles.bin: tiles.png
./png2bin.pl $< 6 ./png2bin.pl $< 6
@ -12,19 +13,26 @@ tiles.bin: tiles.png
sprites.bin: sprites.png sprites.bin: sprites.png
./png2bin.pl $< 12 ./png2bin.pl $< 12
pacemuzx.o: pacemuzx.asm tiles.bin sprites.bin $(ROMS) $(NAME).o: $(NAME).asm tiles.bin sprites.bin $(ROMS)
pasmo --tap pacemuzx.asm pacemuzx.o pacemuzx.sym pasmo --tap $(NAME).asm $(NAME).o $(NAME).sym
dist: $(TAPE) run: $(NAME).tap
ifeq ($(UNAME),Darwin)
open $(NAME).tap
else
xdg-open $(NAME).tap
endif
dist: $(NAME).tap
rm -rf dist rm -rf dist
mkdir dist mkdir dist
cp ReadMe.txt dist/ cp ReadMe.txt dist/
cp Makefile-dist dist/Makefile cp Makefile-dist dist/Makefile
cp make.bat-dist dist/make.bat cp make.bat-dist dist/make.bat
./remove_rom.pl $(TAPE) ./remove_rom.pl $(NAME).tap
mv start.part end.part dist/ mv start.part end.part dist/
clean: clean:
rm -f $(TAPE) pacemuzx.sym pacemuzx.o rm -f $(NAME).tap $(NAME).sym $(NAME).o
rm -f tiles.bin sprites.bin start.part end.part rm -f tiles.bin sprites.bin start.part end.part
rm -rf dist rm -rf dist

View File

@ -1,8 +1,8 @@
TAPE=pacemuzx.tap NAME=pacemuzx
ROMS=pacman.6e pacman.6f pacman.6h pacman.6j ROMS=pacman.6e pacman.6f pacman.6h pacman.6j
$(TAPE): start.part $(ROMS) end.part $(NAME).tap: start.part $(ROMS) end.part
cat start.part $(ROMS) end.part > $(TAPE) cat start.part $(ROMS) end.part > $(NAME).tap
clean: clean:
rm -f $(TAPE) rm -f $(NAME).tap

View File

@ -1,13 +1,17 @@
@echo off @echo off
setlocal
set NAME=pacemuzx
if "%1"=="clean" goto clean if "%1"=="clean" goto clean
png2bin.pl tiles.png 6 png2bin.pl tiles.png 6
png2bin.pl sprites.png 12 png2bin.pl sprites.png 12
pasmo --tap pacemuzx.asm pacemuzx.o pacemuzx.sym pasmo --tap %NAME%.asm %NAME%.o %NAME%.sym
if errorlevel 1 goto end
copy /b loader.tap+pacemuzx.o pacemuzx.tap copy /b loader.tap+%NAME%.o %NAME%.tap
if "%1"=="run" start %NAME%.tap
if not "%1"=="dist" goto end if not "%1"=="dist" goto end
@ -21,9 +25,11 @@ move end.part dist\
goto end goto end
:clean :clean
if exist pacemuzx.tap del pacemuzx.tap pacemuzx.sym pacemuzx.o if exist %NAME%.tap del %NAME%.tap %NAME%.sym %NAME%.o
if exist tiles.bin del tiles.bin sprites.bin if exist tiles.bin del tiles.bin sprites.bin
if exist dist\ del dist\Makefile dist\make.bat dist\start.part dist\end.part dist\pacemuzx.tap if exist dist\ del dist\ReadMe.txt dist\Makefile dist\make.bat dist\start.part dist\end.part
if exist dist\%NAME%.tap del dist\%NAME%.tap
if exist dist\ rmdir dist if exist dist\ rmdir dist
:end :end
endlocal

View File

@ -1,4 +1,6 @@
@echo off @echo off
setlocal
set NAME=pacemuzx
if not exist pacman.6e goto missing if not exist pacman.6e goto missing
if not exist pacman.6f goto missing if not exist pacman.6f goto missing
@ -15,7 +17,7 @@ echo must provide your own copies of:
echo. echo.
echo pacman.6e pacman.6f pacman.6h pacman.6j echo pacman.6e pacman.6f pacman.6h pacman.6j
echo. echo.
echo Copy them to this directory and re-run to generate: pacemuzx.tap echo Copy them to this directory and re-run to generate: %NAME%.tap
echo. echo.
echo **************************************************************** echo ****************************************************************
echo. echo.
@ -23,8 +25,9 @@ pause
goto end goto end
:got_roms :got_roms
copy /b start.part+pacman.6e+pacman.6f+pacman.6h+pacman.6j+end.part pacemuzx.tap copy /b start.part+pacman.6e+pacman.6f+pacman.6h+pacman.6j+end.part %NAME%.tap
start pacemuzx.tap start %NAME%.tap
:end :end
endlocal