diff --git a/Arduino.mk b/Arduino.mk index f9819eb..c1981d0 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -874,9 +874,9 @@ USER_LIB_AS_SRCS = $(wildcard $(patsubst %,%/*.S,$(USER_LIBS))) LIB_OBJS = $(patsubst $(ARDUINO_LIB_PATH)/%.c,$(OBJDIR)/libs/%.o,$(LIB_C_SRCS)) \ $(patsubst $(ARDUINO_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(LIB_CPP_SRCS)) \ $(patsubst $(ARDUINO_LIB_PATH)/%.S,$(OBJDIR)/libs/%.o,$(LIB_AS_SRCS)) -USER_LIB_OBJS = $(patsubst $(USER_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(USER_LIB_CPP_SRCS)) \ - $(patsubst $(USER_LIB_PATH)/%.c,$(OBJDIR)/libs/%.o,$(USER_LIB_C_SRCS)) \ - $(patsubst $(USER_LIB_PATH)/%.S,$(OBJDIR)/libs/%.o,$(USER_LIB_AS_SRCS)) +USER_LIB_OBJS = $(patsubst $(USER_LIB_PATH)/%.cpp,$(OBJDIR)/userlibs/%.o,$(USER_LIB_CPP_SRCS)) \ + $(patsubst $(USER_LIB_PATH)/%.c,$(OBJDIR)/userlibs/%.o,$(USER_LIB_C_SRCS)) \ + $(patsubst $(USER_LIB_PATH)/%.S,$(OBJDIR)/userlibs/%.o,$(USER_LIB_AS_SRCS)) # Dependency files DEPS = $(LOCAL_OBJS:.o=.d) $(LIB_OBJS:.o=.d) $(USER_LIB_OBJS:.o=.d) $(CORE_OBJS:.o=.d) @@ -1034,15 +1034,15 @@ $(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.S @$(MKDIR) $(dir $@) $(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ -$(OBJDIR)/libs/%.o: $(USER_LIB_PATH)/%.cpp +$(OBJDIR)/userlibs/%.o: $(USER_LIB_PATH)/%.cpp @$(MKDIR) $(dir $@) $(CC) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ -$(OBJDIR)/libs/%.o: $(USER_LIB_PATH)/%.c +$(OBJDIR)/userlibs/%.o: $(USER_LIB_PATH)/%.c @$(MKDIR) $(dir $@) $(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@ -$(OBJDIR)/libs/%.o: $(USER_LIB_PATH)/%.S +$(OBJDIR)/userlibs/%.o: $(USER_LIB_PATH)/%.S @$(MKDIR) $(dir $@) $(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ @@ -1092,8 +1092,9 @@ $(OBJDIR)/%.s: %.ino $(COMMON_DEPS) | $(OBJDIR) @$(MKDIR) $(dir $@) $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@ -#$(OBJDIR)/%.lst: $(OBJDIR)/%.s -# $(AS) -$(MCU_FLAG_NAME)=$(MCU) -alhnd $< > $@ +$(OBJDIR)/%.s: %.cpp $(COMMON_DEPS) | $(OBJDIR) + @$(MKDIR) $(dir $@) + $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@ # core files $(OBJDIR)/core/%.o: $(ARDUINO_CORE_PATH)/%.c $(COMMON_DEPS) | $(OBJDIR) diff --git a/HISTORY.md b/HISTORY.md index 173f495..bef7176 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,7 +9,6 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Fix: Change "tinyladi" username to "ladislas" in HISTORY.md. (https://github.com/ladislas) - Add: Add information about `Bare-Arduino–Project` in README. (https://github.com/ladislas) - Fix: Make avr-g++ use CXXFLAGS instead of CFLAGS. (https://github.com/sej7278) -- Add: Add information about overriding system libs (Issue #229). (https://github.com/sej7278) - Add: Add information about reporting bugs to the correct project (Issue #231). (https://github.com/sej7278) - Fix: Allow the use of CFLAGS_STD and CXXFLAGS_STD and set defaults (Issue #234) (https://github.com/ladislas) - Tweak: Remove $(EXTRA_XXX) variables (Issue #234) (https://github.com/ladislas) @@ -17,6 +16,8 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Tweak: Update Malefile-example.mk with STD flags (https://github.com/ladislas) - Add: Allow "make clean" target to be extended (Issue #239). (https://github.com/sej7278) - Fix: Update "make show_boards" regex to work with the Due in 1.5. (https://github.com/sej7278) +- Fix: Allow user libaries/sketches to have the same name as system libs. (Issue #244, #229). (https://github.com/sej7278) +- Tweak: Add cpp to extensions supported by "make generate_assembly". (https://github.com/sej7278) ### 1.3.4 (2014-07-12) - Tweak: Allow spaces in "Serial.begin (....)". (Issue #190) (https://github.com/pdav) diff --git a/arduino-mk-vars.md b/arduino-mk-vars.md index c3a630b..54608d6 100644 --- a/arduino-mk-vars.md +++ b/arduino-mk-vars.md @@ -307,8 +307,6 @@ Directory where additional libraries are stored. Defaults to `libraries` directory within user's sketchbook. -Note that you cannot have user libraries with the same name as the system Arduino libs. - **Example:** ```Makefile