Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / edid / Makefile
blob85a927dfab020af6338259241ca1c27e5f57c299
2 SOURCES := $(wildcard [0-9]*x[0-9]*.S)
4 BIN := $(patsubst %.S, %.bin, $(SOURCES))
6 IHEX := $(patsubst %.S, %.bin.ihex, $(SOURCES))
8 CODE := $(patsubst %.S, %.c, $(SOURCES))
10 all: $(BIN) $(IHEX) $(CODE)
12 clean:
13 @rm -f *.o *.bin.ihex *.bin *.c
15 %.o: %.S
16 @cc -c $^
18 %.bin.nocrc: %.o
19 @objcopy -Obinary $^ $@
21 %.crc: %.bin.nocrc
22 @list=$$(for i in `seq 1 127`; do head -c$$i $^ | tail -c1 \
23 | hexdump -v -e '/1 "%02X+"'; done); \
24 echo "ibase=16;100-($${list%?})%100" | bc >$@
26 %.p: %.crc %.S
27 @cc -c -DCRC="$$(cat $*.crc)" -o $@ $*.S
29 %.bin: %.p
30 @objcopy -Obinary $^ $@
32 %.bin.ihex: %.p
33 @objcopy -Oihex $^ $@
34 @dos2unix $@ 2>/dev/null
36 %.c: %.bin
37 @echo "{" >$@; hexdump -f hex $^ >>$@; echo "};" >>$@