mirror of
https://github.com/a2-4am/4cade.git
synced 2025-02-18 14:30:52 +00:00
use GNU parallel to speed up build process
This commit is contained in:
parent
fa1efd9726
commit
aae1f61ea4
45
Makefile
45
Makefile
@ -23,6 +23,9 @@ ACME=acme
|
|||||||
# version 1.4.0 or later
|
# version 1.4.0 or later
|
||||||
CADIUS=cadius
|
CADIUS=cadius
|
||||||
|
|
||||||
|
# https://www.gnu.org/software/parallel/
|
||||||
|
PARALLEL=parallel
|
||||||
|
|
||||||
# https://bitbucket.org/magli143/exomizer/wiki/Home
|
# https://bitbucket.org/magli143/exomizer/wiki/Home
|
||||||
# version 3.1.0 or later
|
# version 3.1.0 or later
|
||||||
EXOMIZER=exomizer mem -q -P23 -lnone
|
EXOMIZER=exomizer mem -q -P23 -lnone
|
||||||
@ -61,9 +64,7 @@ dsk: index asmproboot asmlauncher
|
|||||||
for i in 1 2 3 4 5 6; do \
|
for i in 1 2 3 4 5 6; do \
|
||||||
$(CADIUS) RENAMEFILE build/"$(DISK)" "/$(VOLUME)/DEMO/SPCARTOON.$${i}$${i}" "SPCARTOON.$${i}." >>build/log; \
|
$(CADIUS) RENAMEFILE build/"$(DISK)" "/$(VOLUME)/DEMO/SPCARTOON.$${i}$${i}" "SPCARTOON.$${i}." >>build/log; \
|
||||||
done
|
done
|
||||||
for f in res/dsk/*.po; do \
|
$(PARALLEL) '$(CADIUS) EXTRACTVOLUME {} build/X/ >>build/log' ::: res/dsk/*.po
|
||||||
$(CADIUS) EXTRACTVOLUME "$${f}" build/X/ >>build/log; \
|
|
||||||
done
|
|
||||||
rm -f build/X/**/.DS_Store build/X/**/PRODOS* build/X/**/LOADER.SYSTEM*
|
rm -f build/X/**/.DS_Store build/X/**/PRODOS* build/X/**/LOADER.SYSTEM*
|
||||||
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/$(VOLUME)/X/" >>build/log
|
$(CADIUS) CREATEFOLDER build/"$(DISK)" "/$(VOLUME)/X/" >>build/log
|
||||||
for f in build/X/*; do \
|
for f in build/X/*; do \
|
||||||
@ -82,9 +83,7 @@ index: md asmfx asmprelaunch compress
|
|||||||
#
|
#
|
||||||
[ -f build/index ] || (bin/converthelp.sh res/HELPTEXT build/HELPTEXT)
|
[ -f build/index ] || (bin/converthelp.sh res/HELPTEXT build/HELPTEXT)
|
||||||
[ -f build/index ] || (bin/converthelp.sh res/CREDITS build/CREDITS)
|
[ -f build/index ] || (bin/converthelp.sh res/CREDITS build/CREDITS)
|
||||||
[ -f build/index ] || (for f in res/GAMEHELP/*; do \
|
[ -f build/index ] || $(PARALLEL) 'bin/converthelp.sh "{}" "build/GAMEHELP/{/}"' ::: res/GAMEHELP/*
|
||||||
bin/converthelp.sh "$$f" build/GAMEHELP/"$$(basename $$f)"; \
|
|
||||||
done)
|
|
||||||
#
|
#
|
||||||
# create a version of GAMES.CONF without comments or blank lines
|
# create a version of GAMES.CONF without comments or blank lines
|
||||||
#
|
#
|
||||||
@ -118,16 +117,10 @@ index: md asmfx asmprelaunch compress
|
|||||||
# precompute indexed files for slideshows
|
# precompute indexed files for slideshows
|
||||||
# note: these can be padded because they're loaded into $800 at a time when $800..$1FFF is clobber-able
|
# note: these can be padded because they're loaded into $800 at a time when $800..$1FFF is clobber-able
|
||||||
#
|
#
|
||||||
[ -f build/index ] || ((for f in res/SS/*; do \
|
[ -f build/index ] || $(PARALLEL) '[ $$(echo "{/}" | cut -c-3) = "ACT" ] && bin/buildslideshow.sh -d build/GAMES.CONF < "{}" > "build/SS/{/}" || bin/buildslideshow.sh build/GAMES.CONF < "{}" > "build/SS/{/}"' ::: res/SS/*
|
||||||
[ $$(echo "$$(basename $$f)" | cut -c-3) = "ACT" ] && \
|
[ -f build/index ] || ((for f in build/SS/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/SS > build/SLIDESHOW.IDX)
|
||||||
bin/buildslideshow.sh -d build/GAMES.CONF < "$$f" > "build/SS/$$(basename $$f)" || \
|
[ -f build/index ] || $(PARALLEL) 'bin/buildokvs.sh < "{}" > "build/ATTRACT/{/}"' ::: res/ATTRACT/*
|
||||||
bin/buildslideshow.sh build/GAMES.CONF < "$$f" > "build/SS/$$(basename $$f)"; \
|
[ -f build/index ] || ((for f in build/ATTRACT/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/ATTRACT > build/MINIATTRACT.IDX)
|
||||||
echo "$$(basename $$f)"; \
|
|
||||||
done) | bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/SS > build/SLIDESHOW.IDX)
|
|
||||||
[ -f build/index ] || ((for f in res/ATTRACT/*; do \
|
|
||||||
bin/buildokvs.sh < "$$f" > "build/ATTRACT/$$(basename $$f)"; \
|
|
||||||
echo "$$(basename $$f)"; \
|
|
||||||
done) | bin/buildindexedfile.sh -p -a build/TOTAL.DATA build/ATTRACT > build/MINIATTRACT.IDX)
|
|
||||||
#
|
#
|
||||||
# precompute indexed files for graphic effects
|
# precompute indexed files for graphic effects
|
||||||
# note: these can be padded because they're loaded into $6000 at a time when $6000..$BEFF is clobber-able
|
# note: these can be padded because they're loaded into $6000 at a time when $6000..$BEFF is clobber-able
|
||||||
@ -155,9 +148,7 @@ index: md asmfx asmprelaunch compress
|
|||||||
# precompute indexed files for SHR artwork
|
# precompute indexed files for SHR artwork
|
||||||
# note: these can not be padded because they are compressed and the decompressor needs the exact size
|
# note: these can not be padded because they are compressed and the decompressor needs the exact size
|
||||||
#
|
#
|
||||||
[ -f build/index ] || ((for f in res/ARTWORK.SHR/*; do \
|
[ -f build/index ] || ((for f in res/ARTWORK.SHR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ARTWORK.SHR > build/ARTWORK.IDX)
|
||||||
echo "$$(basename $$f)"; \
|
|
||||||
done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ARTWORK.SHR > build/ARTWORK.IDX)
|
|
||||||
#
|
#
|
||||||
# create search indexes for each variation of (game-requires-joystick) X (game-requires-128K)
|
# create search indexes for each variation of (game-requires-joystick) X (game-requires-128K)
|
||||||
# in the form of OKVS data structures, plus game counts in the form of source files
|
# in the form of OKVS data structures, plus game counts in the form of source files
|
||||||
@ -214,23 +205,19 @@ asmlauncher: md
|
|||||||
$(ACME) -r build/4cade.lst -DBUILDNUMBER=`git rev-list --count HEAD` -DRELBASE=`cat build/relbase.log | grep "RELBASE =" | cut -d"=" -f2 | cut -d"(" -f2 | cut -d")" -f1` src/4cade.a
|
$(ACME) -r build/4cade.lst -DBUILDNUMBER=`git rev-list --count HEAD` -DRELBASE=`cat build/relbase.log | grep "RELBASE =" | cut -d"=" -f2 | cut -d"(" -f2 | cut -d")" -f1` src/4cade.a
|
||||||
|
|
||||||
asmfx: md
|
asmfx: md
|
||||||
for f in src/fx/*.a; do \
|
$(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/fx/*.a
|
||||||
grep "^\!to" $${f} >/dev/null && $(ACME) $${f} || true; \
|
|
||||||
done
|
|
||||||
|
|
||||||
asmprelaunch: md
|
asmprelaunch: md
|
||||||
for f in src/prelaunch/*.a; do \
|
$(PARALLEL) 'if grep -q "^!to" "{}"; then $(ACME) "{}"; fi' ::: src/prelaunch/*.a
|
||||||
grep "^\!to" $${f} >/dev/null && $(ACME) $${f}; \
|
|
||||||
done
|
|
||||||
|
|
||||||
asmproboot: md
|
asmproboot: md
|
||||||
$(ACME) -r build/proboothd.lst src/proboothd/proboothd.a
|
$(ACME) -r build/proboothd.lst src/proboothd/proboothd.a
|
||||||
|
|
||||||
compress: md
|
compress: md
|
||||||
for f in res/ACTION.HGR.UNCOMPRESSED/*; do o=res/ACTION.HGR/$$(basename $$f); [ -f "$$o" ] || ${EXOMIZER} "$$f"@0x4000 -o "$$o" >>build/log; done
|
$(PARALLEL) '[ -f "res/ACTION.HGR/{/}" ] || ${EXOMIZER} "{}"@0x4000 -o "res/ACTION.HGR/{/}"' ::: res/ACTION.HGR.UNCOMPRESSED/*
|
||||||
for f in res/ACTION.DHGR.UNCOMPRESSED/*; do o=res/ACTION.DHGR/$$(basename $$f); [ -f "$$o" ] || ${EXOMIZER} "$$f"@0x4000 -o "$$o" >>build/log; done
|
$(PARALLEL) '[ -f "res/ACTION.DHGR/{/}" ] || ${EXOMIZER} "{}"@0x4000 -o "res/ACTION.DHGR/{/}"' ::: res/ACTION.DHGR.UNCOMPRESSED/*
|
||||||
for f in res/ARTWORK.SHR.UNCOMPRESSED/*; do o=res/ARTWORK.SHR/$$(basename $$f); [ -f "$$o" ] || ${EXOMIZER} "$$f"@0x2000 -o "$$o" >>build/log; done
|
$(PARALLEL) '[ -f "res/ARTWORK.SHR/{/}" ] || ${EXOMIZER} "{}"@0x2000 -o "res/ARTWORK.SHR/{/}"' ::: res/ARTWORK.SHR.UNCOMPRESSED/*
|
||||||
for f in res/TITLE.HGR.UNPACKED/*; do o=res/TITLE.HGR/$$(basename $$f); [ -f "$$o" ] || bin/packhgrfile.py $$f $$o >>build/log; done
|
$(PARALLEL) '[ -f "res/TITLE.HGR/{/}" ] || bin/packhgrfile.py "{}" "res/TITLE.HGR/{/}"' ::: res/TITLE.HGR.UNPACKED/*
|
||||||
|
|
||||||
#
|
#
|
||||||
# |attract| must be called separately because it is slow and
|
# |attract| must be called separately because it is slow and
|
||||||
|
Loading…
x
Reference in New Issue
Block a user