|
95 | 95 | # 0.9.2 06.vi.2012 Sudar
|
96 | 96 | # - Allow user to choose source files (LOCAL_*_SRCS flags) (https://github.com/Gaftech)
|
97 | 97 | # - Modified 'make size' behavior: using --mcu option and targeting .elf file instead of .hex file.(https://github.com/Gaftech)
|
98 |
| -# |
| 98 | +# |
99 | 99 | # 0.9.3 13.vi.2012 Sudar
|
100 | 100 | # - Autodetect ARDUINO_DIR, Arduino version (https://github.com/rpavlik/)
|
101 | 101 | # - Categorize libs into user and system (https://github.com/rpavlik/)
|
@@ -529,6 +529,9 @@ LOCAL_CC_SRCS ?= $(wildcard *.cc)
|
529 | 529 | LOCAL_PDE_SRCS ?= $(wildcard *.pde)
|
530 | 530 | LOCAL_INO_SRCS ?= $(wildcard *.ino)
|
531 | 531 | LOCAL_AS_SRCS ?= $(wildcard *.S)
|
| 532 | +LOCAL_SRCS = $(LOCAL_C_SRCS) $(LOCAL_CPP_SRCS) \ |
| 533 | + $(LOCAL_CC_SRCS) $(LOCAL_PDE_SRCS) \ |
| 534 | + $(LOCAL_INO_SRCS) $(LOCAL_AS_SRCS) |
532 | 535 | LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.o) $(LOCAL_CPP_SRCS:.cpp=.o) \
|
533 | 536 | $(LOCAL_CC_SRCS:.cc=.o) $(LOCAL_PDE_SRCS:.pde=.o) \
|
534 | 537 | $(LOCAL_INO_SRCS:.ino=.o) $(LOCAL_AS_SRCS:.S=.o)
|
@@ -556,6 +559,17 @@ else
|
556 | 559 | $(call show_config_info,NO_CORE set so core library will not be built,[MANUAL])
|
557 | 560 | endif
|
558 | 561 |
|
| 562 | +######################################################################## |
| 563 | +# Determine ARDUINO_LIBS automatically |
| 564 | +# |
| 565 | + |
| 566 | +ifndef ARDUINO_LIBS |
| 567 | + # automatically determine included libraries |
| 568 | + ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_DIR)/libraries/*)), \ |
| 569 | + $(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(LOCAL_SRCS))) |
| 570 | + ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_SKETCHBOOK)/libraries/*)), \ |
| 571 | + $(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(LOCAL_SRCS))) |
| 572 | +endif |
559 | 573 |
|
560 | 574 | ########################################################################
|
561 | 575 | # Rules for making stuff
|
@@ -833,7 +847,7 @@ ispload: $(TARGET_HEX)
|
833 | 847 | -U lock:w:$(ISP_LOCK_FUSE_POST):m
|
834 | 848 |
|
835 | 849 | clean:
|
836 |
| - $(REMOVE) $(LOCAL_OBJS) $(CORE_OBJS) $(LIB_OBJS) $(CORE_LIB) $(TARGETS) $(DEP_FILE) $(DEPS) $(USER_LIB_OBJS) ${OBJDIR} |
| 850 | + $(REMOVE) $(LOCAL_OBJS) $(CORE_OBJS) $(LIB_OBJS) $(CORE_LIB) $(TARGETS) $(DEP_FILE) $(DEPS) $(USER_LIB_OBJS) ${OBJDIR} |
837 | 851 |
|
838 | 852 | depends: $(DEPS)
|
839 | 853 | cat $(DEPS) > $(DEP_FILE)
|
|
0 commit comments