src-avr: Suspend interrupts while switching stacks
[fw/altos] / ao-bringup-avr / Makefile
index a110b50acd15dfc9d3d93b2119e0710e5355f379..1340594a5c1c8f73945f79b15db7ec01c692b815 100644 (file)
@@ -8,6 +8,8 @@ CC=avr-gcc
 OBJCOPY=avr-objcopy
 CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues
 
+OBJS = ao-blink.o ao-switch.o ao-uart.o ao-bringup.o
+
 all: ao-blink.hex ao-switch.hex ao-uart.hex
 
 ao-blink.hex: ao-blink
@@ -21,8 +23,8 @@ ao-switch.hex: ao-switch
        avr-size ao-switch
        $(OBJCOPY) -R .eeprom -O ihex ao-switch $@
 
-ao-switch: ao-switch.o
-       $(CC) $(CFLAGS) -o $@ ao-switch.o
+ao-switch: ao-switch.o ao-bringup.o
+       $(CC) $(CFLAGS) -o $@ ao-switch.o ao-bringup.o
 
 ao-switch.s: ao-switch.c
        $(CC) $(CFLAGS) -S -o $@ ao-switch.c
@@ -31,12 +33,14 @@ ao-uart.hex: ao-uart
        avr-size ao-uart
        $(OBJCOPY) -R .eeprom -O ihex ao-uart $@
 
-ao-uart: ao-uart.o
-       $(CC) $(CFLAGS) -o $@ ao-uart.o
+ao-uart: ao-uart.o ao-bringup.o
+       $(CC) $(CFLAGS) -o $@ ao-uart.o ao-bringup.o
 
 ao-uart.s: ao-uart.c
        $(CC) $(CFLAGS) -S -o $@ ao-uart.c
 
+$(OBJS): ao-bringup.h
+
 load-blink: ao-blink.hex
        $(LOADCMD) $(LOADARG)ao-blink.hex