BUG: repeated failing makes could generate bad output.

This is a quick fix to address two issues:

* Firstly, if the mec-tools mec_encrypt binary cannot be compiled,
gcc still produces an output file - it is a non executable "precompiled
header" file.  I assume there is a bug in the mec-tools makefile
logic, which I will look for later.

* Secondly, because I am using stdout for file generation, many commands
will still produce an output file even when they fail.  This output file
then looks "good" to the make command, which will carry on to do the
next step.

Since fixing the failed commands in my Makefile makes things more robust
in general, it also avoids the compile issue with the mec-tools.
pull/4/head
Hamish Coleman 8 years ago
parent be0e13896d
commit 2fdb758f6b

3
.gitignore vendored

@ -11,3 +11,6 @@
# ignore generated files
*.bat
# Temp are (should be) just junk
*.tmp

@ -95,10 +95,12 @@ DEPSDIR := .d
$(shell mkdir -p $(DEPSDIR))
-include $(DEPSDIR)/slice.extract.deps
$(DEPSDIR)/slice.extract.deps: Makefile
for i in *.slice; do read SLICEE other <$$i; echo $$i: $$SLICEE; done >$@
for i in *.slice; do read SLICEE other <$$i; echo $$i: $$SLICEE; done >$@.tmp
mv $@.tmp $@
-include $(DEPSDIR)/slice.insert.deps
$(DEPSDIR)/slice.insert.deps: Makefile
for i in *.slice; do read SLICEE other <$$i; echo `basename $$SLICEE .orig`: $$i `basename $$i .slice`; done >$@
for i in *.slice; do read SLICEE other <$$i; echo `basename $$SLICEE .orig`: $$i `basename $$i .slice`; done >$@.tmp
mv $@.tmp $@
# FIXME - the slice.deps targets basically do not handle add/del/change of
# the *.slice files. I dont use any of the regular tricks because I also
@ -121,7 +123,8 @@ $(DEPSDIR)/slice.insert.deps: Makefile
./slice.extract $< $@
%.img.orig: %.img.enc.orig %.img.orig.sha1 mec-tools/mec_encrypt
mec-tools/mec_encrypt -d $< >$@
mec-tools/mec_encrypt -d $< >$@.tmp
mv $@.tmp $@
sha1sum -c $@.sha1
# a generic encryptor
@ -147,7 +150,8 @@ $(DEPSDIR)/slice.insert.deps: Makefile
# my mind to it..
#
%.iso.bat: %.iso.orig %.iso.orig.desc autoexec.bat.template
sed -e "s%__DIR%`mdir -/ -b -i $<@@$(FAT_OFFSET) |grep FL2 |cut -d/ -f3`%; s%__FL2%`mdir -/ -b -i $<@@$(FAT_OFFSET) |grep FL2 |cut -d/ -f4`%; s%__DESC%`cat $<.desc`%" autoexec.bat.template >$@
sed -e "s%__DIR%`mdir -/ -b -i $<@@$(FAT_OFFSET) |grep FL2 |cut -d/ -f3`%; s%__FL2%`mdir -/ -b -i $<@@$(FAT_OFFSET) |grep FL2 |cut -d/ -f4`%; s%__DESC%`cat $<.desc`%" autoexec.bat.template >$@.tmp
mv $@.tmp $@
# helper to write the ISO onto a cdrw
%.iso.blank_burn: %.iso
@ -158,11 +162,13 @@ $(DEPSDIR)/slice.insert.deps: Makefile
cp --reflink=auto $< $(basename $<)
%.hex: %
hd -v $< >$@
hd -v $< >$@.tmp
mv $@.tmp $@
# Generate a patch report
%.diff: %.hex %.orig.hex
-diff -u $(basename $@).orig.hex $(basename $@).hex >$@
-diff -u $(basename $@).orig.hex $(basename $@).hex >$@.tmp
mv $@.tmp $@
cat $@
# If we ever want a copy of the dosflash.exe, just get it from the iso image

Loading…
Cancel
Save