From e046112c8342d05d1f1f5e5058b2e5a212267db5 Mon Sep 17 00:00:00 2001 From: Sudar Date: Sat, 12 May 2012 13:26:00 +0530 Subject: [PATCH] Added support for compiling .pde files in Arduino 1.0 environment --- arduino-mk/Arduino.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index f2dc959..70637ca 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -564,9 +564,11 @@ $(OBJDIR)/%.d: %.S $(OBJDIR)/%.d: %.s $(CC) -MM $(CPPFLAGS) $(ASFLAGS) $< -MF $@ -MT $(@:.d=.o) +#backward compatibility for .pde files +# We should check for Arduino version, if the file is .pde because a .pde file might be used in Arduino 1.0 # the pde -> cpp -> o file $(OBJDIR)/%.cpp: %.pde - $(ECHO) '#include "WProgram.h"' > $@ + $(ECHO) '#if ARDUINO >= 100\n #include "Arduino.h"\n#else\n #include "WProgram.h"\n#endif' > $@ $(CAT) $< >> $@ # the ino -> cpp -> o file