include $(TOPDIR)/samd21/Makefile-samd21.defs

INC = \
	ao.h \
	ao_arch.h \
	ao_arch_funcs.h \
	ao_flash_pins.h \
	ao_flash_samd21_pins.h \
	ao_flash_task.h \
	ao_pins.h \
	ao_product.h \
	Makefile

#
# Common AltOS sources
#
SRC = \
	ao_interrupt.c \
	ao_romconfig.c \
	ao_boot_chain.c \
	ao_boot_pin.c \
	ao_product.c \
	ao_notask.c \
	ao_timer.c \
	ao_usb_samd21.c \
	ao_flash_samd21.c \
	ao_flash_task.c \
	ao_flash_loader_samd21.c

OBJ=$(SRC:.c=.o)

PRODUCT=AltosFlash
PRODUCT_DEF=-DALTOS_FLASH
IDPRODUCT=0x000a

CFLAGS = $(PRODUCT_DEF) $(SAMD21_CFLAGS)

LDFLAGS=-nostartfiles $(CFLAGS) -L$(TOPDIR)/samd21 -Taltos-loader.ld -n

PROGNAME=$(HARDWARE)-altos-flash
PROG=$(PROGNAME)-$(VERSION).elf

$(PROG): Makefile $(OBJ) altos-loader.ld
	$(call quiet,CC) $(LDFLAGS) -o $(PROG) $(OBJ) $(LIBS)

$(OBJ): $(INC)

all: $(PROG)

distclean:	clean

clean:
	rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.map
	rm -f ao_product.h

install:

uninstall:
