altos: Change flash loader name to just AltosFlash
[fw/altos] / src / lpc / Makefile-flash.defs
index 6bdd204c3949113af7f2eece2c90aeb495a1acfa..4a245d103989a70b267f035eff07ec3447978337 100644 (file)
@@ -1,37 +1,4 @@
-vpath % $(TOPDIR)/lpc:$(TOPDIR)/product:$(TOPDIR)/drivers:$(TOPDIR)/core:$(TOPDIR)/util:$(TOPDIR)
-vpath ao-make-product.5c $(TOPDIR)/util
-
-.SUFFIXES: .elf .ihx
-
-.elf.ihx:
-       objcopy -O ihex $*.elf $@
-
-CC=arm-none-eabi-gcc
-SAT=/opt/cortex
-SAT_CLIB=$(SAT)/lib/pdclib-cortex-m0.a
-SAT_CFLAGS=-I$(SAT)/include
-
-ifndef VERSION
-include $(TOPDIR)/Version
-endif
-
-AO_CFLAGS=-I. -I$(TOPDIR)/lpc -I$(TOPDIR)/core -I$(TOPDIR)/drivers -I$(TOPDIR)/product -I$(TOPDIR)
-STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m0 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS)
-
-LDFLAGS=-L$(TOPDIR)/lpc -Wl,-Taltos-loader.ld
-
-NICKLE=nickle
-
-V=0
-# The user has explicitly enabled quiet compilation.
-ifeq ($(V),0)
-quiet = @printf "  $1 $2 $@\n"; $($1)
-endif
-# Otherwise, print the full command line.
-quiet ?= $($1)
-
-.c.o:
-       $(call quiet,CC) -c $(CFLAGS) -o $@ $<
+include $(TOPDIR)/lpc/Makefile-lpc.defs
 
 INC = \
        ao.h \
@@ -62,17 +29,19 @@ SRC = \
 
 OBJ=$(SRC:.c=.o)
 
-PRODUCT=AltosFlash-$(VERSION)
+PRODUCT=AltosFlash
 PRODUCT_DEF=-DALTOS_FLASH
 IDPRODUCT=0x000a
 
-CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) -g -Os
+CFLAGS = $(PRODUCT_DEF) $(LPC_CFLAGS) -g -Os
+
+LDFLAGS=$(CFLAGS) -L$(TOPDIR)/lpc -Wl,-Taltos-loader.ld
 
 PROGNAME=altos-flash
 PROG=$(HARDWARE)-$(PROGNAME)-$(VERSION).elf
 
 $(PROG): Makefile $(OBJ) altos-loader.ld
-       $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc
+       $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS)
 
 ao_product.h: ao-make-product.5c $(TOPDIR)/Version
        $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
@@ -84,7 +53,7 @@ all: $(PROG)
 distclean:     clean
 
 clean:
-       rm -f *.o $(PROG)
+       rm -f *.o $(HARDWARE)-$(PROGNAME)-*.elf
        rm -f ao_product.h
 
 install: