snapshot of my first "working" version from turn-on of Altus Metrum v0.1
[fw/openalt] / Makefile
index 28b15e1a7f09cd2b7d0cb91e9cbd08f1abd0c07b..11bd29d5aefc37e2efbd027481722fc15e053eb2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.SILENT: 
+#.SILENT: 
 
 #
 #  -D CFG_CONSOLE_USB   for console on USB
@@ -17,7 +17,7 @@ export OBJCOPY=arm-elf-objcopy
 export OBJDUMP=arm-elf-objdump
 export CRT0=boot.s
 export WARNINGS=-Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused
-export CFLAGS=$(WARNINGS) -D RUN_MODE=RUN_FROM_ROM -D GCC_ARM7 $(INCLUDES) $(BASEINCLUDE) -mcpu=arm7tdmi -T$(LDSCRIPT) -g -O3 -fomit-frame-pointer $(LPC2148DEMO_OPTS)
+export CFLAGS=$(WARNINGS) -D RUN_MODE=RUN_FROM_ROM -D GCC_ARM7 $(INCLUDES) $(BASEINCLUDE) -mcpu=arm7tdmi -T$(LDSCRIPT) -g -O3 -fomit-frame-pointer $(LPC2148DEMO_OPTS) -DFC1025 -DBDALE
 export LDSCRIPT=lpc2148-rom.ld
 export LINKER_FLAGS=$(COMMON)/common.a -Xlinker -olpc2148.elf -Xlinker -M -Xlinker -Map=lpc2148.map
 export ROOT=$(shell pwd)
@@ -38,11 +38,22 @@ all :
        @for i in $(SUBDIRS); do \
        (cd $$i; $(MAKE) $(MFLAGS) $(MYMAKEFLAGS) all); done
        make lpc2148.hex
+       make lpc2148.bin
+
+program:       lpc2148.bin
+       sudo openocd -f ./openocd-flash.cfg
+
+debug: lpc2148.bin
+       sudo openocd -f ./openocd-debug.cfg
 
 lpc2148.hex : .depend Makefile lpc2148.elf
        $(OBJCOPY) lpc2148.elf -O ihex lpc2148.hex
        @echo "Length is " `grep __"end_of_text__ = ." *.map | cut -b 17-35` "bytes"
 
+lpc2148.bin : .depend Makefile lpc2148.elf
+       $(OBJCOPY) lpc2148.elf -O binary lpc2148.bin
+       @echo "Length is " `grep __"end_of_text__ = ." *.map | cut -b 17-35` "bytes"
+
 lpc2148.elf : .depend Makefile $(ARM_OBJ) $(COMMON)/common.a $(CRT0) $(LDSCRIPT)
        $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
        $(OBJDUMP) -d -S lpc2148.elf >lpc2148.lst