summaryrefslogtreecommitdiff
path: root/include.mk
diff options
context:
space:
mode:
Diffstat (limited to 'include.mk')
-rw-r--r--include.mk22
1 files changed, 20 insertions, 2 deletions
diff --git a/include.mk b/include.mk
index cfbc3e3..3f03342 100644
--- a/include.mk
+++ b/include.mk
@@ -111,6 +111,14 @@ DFU = dfu-programmer
teensy = teensy_loader_cli
avrdude = avrdude
+## external libs
+EXTERNAL_LIBS :=
+
+LUFA_STAMP = .lufa_stamp
+ifdef LUFA_DIR
+EXTERNAL_LIBS += prepare-lufa
+endif
+
## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)
@@ -138,12 +146,21 @@ OBJ_LIB := $(LIBS:%=lib-%.o)
SRC_LIB := $(LIBS:%=$(LIB_DIR)/%.c)
DEP_LIB := $(LIBS:%=lib-%.d)
-.PHONY: clean program erase flash reset run
+.PHONY: prepare clean program erase flash reset run
ELFFILE := $(NAME).elf
HEXFILE := $(NAME).hex
-all: $(HEXFILE)
+all: prepare $(HEXFILE)
+prepare: $(EXTERNAL_LIBS)
+prepare-lufa: $(LUFA_STAMP)
+
+$(LUFA_STAMP):
+ @echo "preparing external LUFA lib ($(LUFA_DIR))"
+ @echo " --- TODO ---"
+## call LUFA build
+ @touch $@
+
lib-%.d: $(LIB_DIR)/%.c
@set -e; rm -f $@; \
@@ -175,6 +192,7 @@ $(HEXFILE): $(ELFFILE)
$(OBJCOPY) -O ihex -R .eeprom -R .fuse -R .lock -R .signature $< $@
clean:
+ rm -f .*_stamp
rm -f *.o
rm -f *.d
rm -f *.d.*