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
)
13 @
rm -f
*.o
*.bin.ihex
*.bin
*.c
19 @objcopy
-Obinary
$^
$@
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
>$@
27 @
cc -c
-DCRC
="$$(cat $*.crc)" -o
$@
$*.S
30 @objcopy
-Obinary
$^
$@
34 @dos2unix
$@
2>/dev
/null
37 @echo
"{" >$@
; hexdump
-f hex
$^
>>$@
; echo
"};" >>$@