summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include.mk22
-rw-r--r--usb-serial/Makefile1
2 files changed, 21 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.*
diff --git a/usb-serial/Makefile b/usb-serial/Makefile
index d24433d..b1f7687 100644
--- a/usb-serial/Makefile
+++ b/usb-serial/Makefile
@@ -24,5 +24,6 @@ NAME := usb-serial
OBJ := $(NAME).o
LIBS := util led
BOARD_TYPE := teensy2
+LUFA_DIR := ../contrib/LUFA-120219
include ../include.mk