aboutsummaryrefslogtreecommitdiff
path: root/flash_write/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'flash_write/Makefile')
-rw-r--r--flash_write/Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/flash_write/Makefile b/flash_write/Makefile
new file mode 100644
index 0000000..2bc9417
--- /dev/null
+++ b/flash_write/Makefile
@@ -0,0 +1,17 @@
+#all:
+# gcc -Wall -O0 -mcpu=arm7tdmi-s -mapcs -mthumb-interwork -o flash.o flash.c -nostartfiles -nodefaultlibs -nostdlib -Wl,-e,main
+# objcopy -Obinary -j.text flash.o flash.bin
+# objdump --disassemble-all -bbinary -marm7tdmi flash.bin > flash.asm
+#
+
+TOOL_PREFIX=arm-elf-
+
+all:
+ $(TOOL_PREFIX)gcc -W -Wall -O3 -mcpu=arm7tdmi -mapcs -mthumb-interwork -c -o flash.o flash.c
+ $(TOOL_PREFIX)as --warn -mcpu=arm7tdmi -mapcs-32 -EL -mthumb-interwork -o crt0.o crt0.s
+ $(TOOL_PREFIX)ld -O3 --gc-sections crt0.o flash.o -o flash
+ $(TOOL_PREFIX)objcopy -O binary flash flash.bin
+ $(TOOL_PREFIX)objdump --disassemble-all -b binary -m arm7tdmi flash.bin > flash.asm
+
+clean:
+ rm -f flash.o flash.bin flash.asm