diff options
author | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-08-21 00:21:54 -0500 |
---|---|---|
committer | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-08-21 00:21:54 -0500 |
commit | ed6f1106322f8ca4a6e26d08365bb9558ffa9d09 (patch) | |
tree | 0258d4a7b0429c82b4f7af8d63106ea93e7150de /newasm/Makefile | |
parent | d23ab4295a865580f6cb7bb4526978bac388b5ac (diff) |
Start new assembler
Diffstat (limited to 'newasm/Makefile')
-rw-r--r-- | newasm/Makefile | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/newasm/Makefile b/newasm/Makefile new file mode 100644 index 0000000..3302630 --- /dev/null +++ b/newasm/Makefile @@ -0,0 +1,39 @@ +PICO = /dev/disk/by-label/RPI-RP2 +DEVICE = /dev/ttyUSB0 + +.PHONY: build +build: parse.he + +parse.he: parse.bin + od -An -tx2 -v parse.bin | sed "s/^ //" | tr " " "\n" | tr [:lower:] [:upper:] | sed "s/^/0x/" > parse.he + +parse.bin: parse.elf + arm-none-eabi-objcopy -O binary parse.elf parse.bin + +objects = main.o uart.o data.o string.o input.o + +parse.elf: pico_bin.ld $(objects) + arm-none-eabi-ld -T pico_bin.ld -o parse.elf $(objects) + +$(objects): %.o: %.s + arm-none-eabi-as -o $@ $< + +.PHONY: clean +clean: + rm -f parse.elf parse.bin parse.he slowcat $(objects) + +.PHONY: dump +dump: parse.bin + @od -Ax -tx2 -v parse.bin + +.PHONY: serial +serial: $(DEVICE) parse.he slowcat + cat parse.he | tr "\n" "\r" | ./slowcat | picocom -b 115200 -q $(DEVICE) + @echo + echo -n "G" | picocom -b 115200 -q $(DEVICE) + @echo + +$(DEVICE): + @echo Serial device not found + @echo Connect USB cable from USB-UART bridge + @false |