Skip to content

Commit 7af27ae

Browse files
committed
Use ARDUINO_HEADER variable instead of hardcoded file names
Fix #131
1 parent a51754c commit 7af27ae

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

HISTORY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
1818
- Tweak: Don't append port details to avrdude for usbtiny. Fix #140 and #138 (https://github.com/PPvG)
1919
- Fix: Handle relative paths of bootloader file while burning bootloaders. Fix #126 and #142 (https://github.com/sej7278)
2020
- New: Add `CONTRIBUTING.md` explaining how to contribute to the project.
21-
- Force -Os optimization for SoftwareSerial. Add `OPTIMIZATION_FLAGS` and `DEBUG_FLAGS`.
21+
- New: Force -Os optimization for SoftwareSerial. Add `OPTIMIZATION_FLAGS` and `DEBUG_FLAGS`. (https://github.com/mahoy)
22+
- Fix: Use `ARDUINO_HEADER` variable instead of hardcoded file names. Fix #131
2223

2324
### 1.0.1 (2013-09-25)
2425
- Unconditionally add -D in avrdude options. See #114

arduino-mk/Arduino.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -703,11 +703,11 @@ ifeq ($(strip $(NO_CORE)),)
703703
endif
704704

705705
########################################################################
706-
# Include file to use for old .pde files
706+
# Include Arduino Header file
707707

708708
ifndef ARDUINO_HEADER
709-
# We should check for Arduino version, if the file is .pde because a
710-
# .pde file might be used in Arduino 1.0
709+
# We should check for Arduino version, not just the file extension
710+
# because, a .pde file can be used in Arduino 1.0 as well
711711
ifeq ($(shell expr $(ARDUINO_VERSION) '<' 100), 1)
712712
ARDUINO_HEADER=WProgram.h
713713
else
@@ -931,7 +931,7 @@ $(OBJDIR)/%.o: %.pde $(COMMON_DEPS) | $(OBJDIR)
931931
# the ino -> o file
932932
$(OBJDIR)/%.o: %.ino $(COMMON_DEPS) | $(OBJDIR)
933933
@$(MKDIR) $(dir $@)
934-
$(CXX) -x c++ -include Arduino.h -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
934+
$(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
935935

936936
# generated assembly
937937
$(OBJDIR)/%.s: %.pde $(COMMON_DEPS) | $(OBJDIR)
@@ -940,7 +940,7 @@ $(OBJDIR)/%.s: %.pde $(COMMON_DEPS) | $(OBJDIR)
940940

941941
$(OBJDIR)/%.s: %.ino $(COMMON_DEPS) | $(OBJDIR)
942942
@$(MKDIR) $(dir $@)
943-
$(CXX) -x c++ -include Arduino.h -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@
943+
$(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@
944944

945945
#$(OBJDIR)/%.lst: $(OBJDIR)/%.s
946946
# $(AS) -$(MCU_FLAG_NAME)=$(MCU) -alhnd $< > $@

0 commit comments

Comments
 (0)