Use new Makefile.defs in stm-demo
authorKeith Packard <keithp@keithp.com>
Fri, 23 Mar 2012 07:43:17 +0000 (00:43 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 29 Mar 2012 04:37:04 +0000 (21:37 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm-demo/Makefile

index ecdf6b7f28b27cf36cc0fc860213b69812b3375a..f2e6618e19ace9e83609d3d118e067f1202c0e21 100644 (file)
@@ -2,32 +2,16 @@
 # AltOS build
 #
 #
-vpath % ..:../core:../product:../drivers:../stm
-vpath make-altitude ../util
-vpath make-kalman ../util
-vpath kalman.5c ../kalman
-vpath kalman_filter.5c ../kalman
-vpath load_csv.5c ../kalman
-vpath matrix.5c ../kalman
-vpath ao-make-product.5c ../util
-
-#PROGRAMMER=stk500v2 -P usb
-#PROGRAMMER=usbtiny
-#LOADCMD=avrdude
-#LOADARG=-p $(DUDECPUTYPE) -c $(PROGRAMMER) -e -U flash:w:
-CC=arm-none-eabi-gcc
-#OBJCOPY=avr-objcopy
-
-ifndef VERSION
-include ../Version
-endif
+
+include ../stm/Makefile.defs
 
 INC = \
        ao.h \
        ao_arch.h \
        ao_pins.h \
        altitude.h \
-       ao_kalman.h
+       ao_kalman.h \
+       ao_product.h
 
 #
 # Common AltOS sources
@@ -49,33 +33,20 @@ ALTOS_SRC = \
 PRODUCT=StmDemo-v0.0
 PRODUCT_DEF=-DSTM_DEMO
 IDPRODUCT=0x000a
-CPU=cortex-m3
-CFLAGS = $(PRODUCT_DEF) -I. -I../stm -I../core -I..
-CFLAGS += -g -std=gnu99 -O0 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib -I../stm $(CINC)
 
-NICKLE=nickle
+CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS)
 
 PROG=stm-demo
 
 SRC=$(ALTOS_SRC) ao_demo.c
 OBJ=$(SRC:.c=.o)
 
-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)
-
 all: $(PROG)
 
-CLIB=/home/keithp/sat/lib/pdclib.a
-CINC=-I/home/keithp/sat/include
 LDFLAGS=-L../stm -Wl,-Taltos.ld
 
 $(PROG): Makefile $(OBJ)
-       $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(CLIB) -lgcc
+       $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc
 
 ../altitude.h: make-altitude
        nickle $< > $@
@@ -97,5 +68,3 @@ clean:
 install:
 
 uninstall:
-
-$(OBJ): ao.h ao_product.h
\ No newline at end of file