diff --git a/HISTORY.md b/HISTORY.md index d52d981..f075ede 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -18,7 +18,8 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Tweak: Don't append port details to avrdude for usbtiny. Fix #140 and #138 (https://github.com/PPvG) - Fix: Handle relative paths of bootloader file while burning bootloaders. Fix #126 and #142 (https://github.com/sej7278) - New: Add `CONTRIBUTING.md` explaining how to contribute to the project. -- Force -Os optimization for SoftwareSerial. Add `OPTIMIZATION_FLAGS` and `DEBUG_FLAGS`. +- New: Force -Os optimization for SoftwareSerial. Add `OPTIMIZATION_FLAGS` and `DEBUG_FLAGS`. (https://github.com/mahoy) +- Fix: Use `ARDUINO_HEADER` variable instead of hardcoded file names. Fix #131 ### 1.0.1 (2013-09-25) - Unconditionally add -D in avrdude options. See #114 diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 5ee2fdb..2d76275 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -703,11 +703,11 @@ ifeq ($(strip $(NO_CORE)),) endif ######################################################################## -# Include file to use for old .pde files +# Include Arduino Header file ifndef ARDUINO_HEADER - # We should check for Arduino version, if the file is .pde because a - # .pde file might be used in Arduino 1.0 + # We should check for Arduino version, not just the file extension + # because, a .pde file can be used in Arduino 1.0 as well ifeq ($(shell expr $(ARDUINO_VERSION) '<' 100), 1) ARDUINO_HEADER=WProgram.h else @@ -931,7 +931,7 @@ $(OBJDIR)/%.o: %.pde $(COMMON_DEPS) | $(OBJDIR) # the ino -> o file $(OBJDIR)/%.o: %.ino $(COMMON_DEPS) | $(OBJDIR) @$(MKDIR) $(dir $@) - $(CXX) -x c++ -include Arduino.h -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ + $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ # generated assembly $(OBJDIR)/%.s: %.pde $(COMMON_DEPS) | $(OBJDIR) @@ -940,7 +940,7 @@ $(OBJDIR)/%.s: %.pde $(COMMON_DEPS) | $(OBJDIR) $(OBJDIR)/%.s: %.ino $(COMMON_DEPS) | $(OBJDIR) @$(MKDIR) $(dir $@) - $(CXX) -x c++ -include Arduino.h -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@ + $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@ #$(OBJDIR)/%.lst: $(OBJDIR)/%.s # $(AS) -$(MCU_FLAG_NAME)=$(MCU) -alhnd $< > $@