Permalink
Browse files

Build system improvements

- added basic 'make run' for Linux using xdg-open
- fixed Win32 clean rule so it removes all files cleanly
- easier to change target basename
- adding missing endlocal to make.bat
  • Loading branch information...
simonowen committed Jun 3, 2013
1 parent 50591e8 commit 2e837a191625835c4a9de8b37838054f723b767d
Showing with 33 additions and 20 deletions.
  1. +12 −7 Makefile
  2. +4 −4 Makefile-dist
  3. +11 −6 make.bat
  4. +6 −3 make.bat-dist
View
@@ -1,5 +1,6 @@
DISK=pacemu.dsk
NAME=pacemu
ROMS=pacman.6e pacman.6f pacman.6h pacman.6j
UNAME := $(shell uname -s)
.PHONY: dist clean
@@ -9,13 +10,17 @@ ROMS=pacman.6e pacman.6f pacman.6h pacman.6j
#sprites.bin: sprites.png
# ./png2bin.pl $< 12
$(DISK): pacemu.asm sound.bin sprites.bin tiles.bin $(ROMS)
pyz80.py --exportfile=pacemu.sym pacemu.asm
$(NAME).dsk: $(NAME).asm sound.bin sprites.bin tiles.bin $(ROMS)
pyz80.py -I samdos2 --exportfile=$(NAME).sym $(NAME).asm
run: $(DISK)
open $(DISK)
run: $(NAME).dsk
ifeq ($(UNAME),Darwin)
open $(NAME).dsk
else
xdg-open $(NAME).dsk
endif
dist:
dist: $(NAME).dsk
rm -rf dist
mkdir dist
cp ReadMe.txt dist/
@@ -25,7 +30,7 @@ dist:
mv disk.base dist/
clean:
rm -f $(DISK) pacemu.sym
rm -f $(NAME).dsk $(NAME).sym
# rm -f tiles.bin sprites.bin
rm -f disk.base
rm -rf dist
View
@@ -1,8 +1,8 @@
DISK=pacemu.dsk
NAME=pacemu
ROMS=pacman.6e pacman.6f pacman.6h pacman.6j
$(DISK): disk.base $(ROMS)
cat disk.base $(ROMS) > $(DISK)
$(NAME).dsk: disk.base $(ROMS)
cat disk.base $(ROMS) > $(NAME).dsk
clean:
rm -f $(DISK)
rm -f $(NAME).dsk
View
@@ -1,14 +1,18 @@
@echo off
setlocal
set NAME=pacemu
if "%1"=="clean" goto clean
if "%1"=="dist" goto dist
rem png2bin.pl tiles.png 6
rem png2bin.pl sprites.png 12
pyz80.py --exportfile=pacemu.sym pacemu.asm
pyz80.py -I samdos2 --exportfile=%NAME%.sym %NAME%.asm
if errorlevel 1 goto end
if "%1"=="run" start pacemu.dsk
if "%1"=="dist" goto dist
if "%1"=="run" start %NAME%.dsk
goto end
:dist
@@ -21,10 +25,11 @@ move disk.base dist\
goto end
:clean
if exist pacemu.dsk del pacemu.dsk pacemu.sym
if exist %NAME%.dsk del %NAME%.dsk %NAME%.sym
rem if exist tiles.bin del tiles.bin sprites.bin
if exist dist\ del dist\Makefile dist\make.bat dist\disk.base
if exist dist\pacemu.dsk del dist\pacemu.dsk
if exist dist\ del dist\ReadMe.txt dist\Makefile dist\make.bat dist\disk.base
if exist dist\%NAME%.dsk del dist\%NAME%.dsk
if exist dist\ rmdir dist
:end
endlocal
View
@@ -1,4 +1,6 @@
@echo off
setlocal
set NAME=pacemu
if not exist pacman.6e goto missing
if not exist pacman.6f goto missing
@@ -15,18 +17,19 @@ echo must provide your own copies of:
echo.
echo pacman.6e pacman.6f pacman.6h pacman.6j
echo.
echo Copy them to this directory and re-run to generate: pacemu.dsk
echo Copy them to this directory and re-run to generate: %NAME%.dsk
echo.
echo ****************************************************************
echo.
pause
goto end
:got_roms
copy /b disk.base+pacman.6e+pacman.6f+pacman.6h+pacman.6j pacemu.dsk
copy /b disk.base+pacman.6e+pacman.6f+pacman.6h+pacman.6j %NAME%.dsk
echo.
echo pacemu.dsk is ready to launch in SimCoupe, or transfer to floppy!
echo %NAME%.dsk is ready to launch in SimCoupe, or transfer to floppy!
echo.
:end
endlocal

0 comments on commit 2e837a1

Please sign in to comment.