diff options
author | root <root@filebitch> | 2011-08-28 18:28:51 +0200 |
---|---|---|
committer | root <root@filebitch> | 2011-08-28 18:28:51 +0200 |
commit | c8c27e3af96a84ccf8ecdfd7610e49dba0598e7d (patch) | |
tree | 3cb1a59b301f91b6a1524b48fb9d828a78a43dac /oncology/dpfhack_display/reverse/Makefile | |
parent | 99bdbc04f2be1f0d27c4a4dde692e8a5b6eb8a7e (diff) | |
parent | 7a97f9d4baff89bbcfa4bef93ab4d4246b2b82e6 (diff) |
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'oncology/dpfhack_display/reverse/Makefile')
-rw-r--r-- | oncology/dpfhack_display/reverse/Makefile | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/oncology/dpfhack_display/reverse/Makefile b/oncology/dpfhack_display/reverse/Makefile new file mode 100644 index 00000000..d0a28b68 --- /dev/null +++ b/oncology/dpfhack_display/reverse/Makefile @@ -0,0 +1,76 @@ +# Makefile for DPF firmware analysis + + +CFLAGS = -g + +ASFLAGS = -plosgff + +ifndef DUMP + DUMP = -d +endif + +VERSION = 0.01develop + +AS = asx8051 + +INFILES = $(wildcard code*.in) $(wildcard dump*.in) $(wildcard data*.in) + +ASMFILES = $(INFILES:%.in=%.asm) +BINFILES = $(INFILES:%.in=%.bin) + +all: $(ASMFILES) + +show: + echo $(ASMFILES) + +all.asm: $(ASMFILES) + @echo concatenating all ASM files into $@ + @cat $(ASMFILES) > $@ + +%.rel : %.asm + $(AS) $(ASFLAGS) $< + +# Fixup format: +%.asm: %.d52 + @echo Generating $@ + @sed 's/\.equ/=/g;s/^\s*end/; END/g' $< > $@ + +test: main.o + $(CC) -o $@ $< + +clean: cleanimages + rm -f test *.ctl *.asm dump*.bin code*.bin *.d52 *.lst *.rel *.sym + +common.in: + ln -s ../common.in . + +dump%.ctl: dump%.in common.in + @cat $< common.in >$@ + +code_%.ctl: code_%.in common.in + @cat $< common.in >$@ + +data_%.ctl: data_%.in + @cp $< $@ + +%.d52: %.bin %.ctl + @d52 -p -b $(DUMP) -n $< # >/dev/null + +cleanimages: + rm -fr images/* + +RAWFILES = $(wildcard *.raw) + +IMAGES = $(RAWFILES:%.raw=images/%.png) + +images/%.png: %.raw + convert -size 128x128 -depth 1 gray:$< $@ + +images: $(IMAGES) + +dump: + PWD=`pwd`; BASE=`basename $$PWD`; \ + echo $$BASE; \ + python ../dump.py $$BASE full_image.bin + +.PHONY: dump |