Initial commit

This commit is contained in:
Trevor Joynson (trevorj)
2016-06-09 20:21:16 -04:00
parent adce4ea4e7
commit 6a1dc7e89c
14 changed files with 799 additions and 0 deletions

31
Makefile Normal file
View File

@@ -0,0 +1,31 @@
SOURCES := $(wildcard [0-9]*x[0-9]*.S)
BIN := $(patsubst %.S, %.bin, $(SOURCES))
IHEX := $(patsubst %.S, %.bin.ihex, $(SOURCES))
CODE := $(patsubst %.S, %.c, $(SOURCES))
all: $(BIN) $(IHEX) $(CODE)
clean:
rm -f *.o *.bin.ihex *.bin *.c
%.o: %.S
cc -c $^
%.bin: %.o
objcopy -Obinary $^ $@
%.bin.ihex: %.o
objcopy -Oihex $^ $@
dos2unix $@ 2>/dev/null
%.c: %.bin
@echo "{" >$@; hexdump -f hex $^ >>$@; echo "};" >>$@
%.crc: %.bin
./compute-crc $^ >$@
echo $(MAKE) $^