summaryrefslogtreecommitdiff
path: root/devel/arduino-mk/files/patch-arduino-mk-Arduino.mk
blob: c695d37cf8aa4553ecc7d8c49eb57a2b49e57403 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- arduino-mk/Arduino.mk.orig	2012-09-17 10:41:19.000000000 -0700
+++ arduino-mk/Arduino.mk	2012-09-17 19:21:52.000000000 -0700
@@ -160,7 +160,7 @@
 #
 #    ARDUINO_LIBS - A list of any libraries used by the sketch (we
 #                   assume these are in
-#                   $(ARDUINO_DIR)/hardware/libraries 
+#                   $(ARDUINO_DIR)/libraries 
 #
 #    ARDUINO_PORT - The port where the Arduino can be found (only needed
 #                   when uploading
@@ -287,7 +287,7 @@
 #
 # Arduino version number
 ifndef ARDUINO_VERSION
-ARDUINO_VERSION = 100
+ARDUINO_VERSION = %%ARDUINO%%
 endif
 
 ########################################################################
@@ -448,12 +448,12 @@
 ########################################################################
 # Local sources
 #
-LOCAL_C_SRCS    = $(wildcard *.c)
-LOCAL_CPP_SRCS  = $(wildcard *.cpp)
-LOCAL_CC_SRCS   = $(wildcard *.cc)
-LOCAL_PDE_SRCS  = $(wildcard *.pde)
-LOCAL_INO_SRCS  = $(wildcard *.ino)
-LOCAL_AS_SRCS   = $(wildcard *.S)
+LOCAL_C_SRCS    ?= $(wildcard *.c)
+LOCAL_CPP_SRCS  ?= $(wildcard *.cpp)
+LOCAL_CC_SRCS   ?= $(wildcard *.cc)
+LOCAL_PDE_SRCS  ?= $(wildcard *.pde)
+LOCAL_INO_SRCS  ?= $(wildcard *.ino)
+LOCAL_AS_SRCS   ?= $(wildcard *.S)
 LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.o)   $(LOCAL_CPP_SRCS:.cpp=.o) \
 		$(LOCAL_CC_SRCS:.cc=.o)   $(LOCAL_PDE_SRCS:.pde=.o) \
 		$(LOCAL_INO_SRCS:.ino=.o) $(LOCAL_AS_SRCS:.S=.o)
@@ -593,7 +593,11 @@
 
 # the pde -> cpp -> o file
 $(OBJDIR)/%.cpp: %.pde
-	$(ECHO) '#include "WProgram.h"' > $@
+	$(ECHO) '#if ARDUINO >= 100' > $@
+	$(ECHO) '#include "Arduino.h"' >> $@
+	$(ECHO) '#else' >> $@
+	$(ECHO) '#include "WProgram.h"' >> $@
+	$(ECHO) '#endif' >> $@
 	$(CAT)  $< >> $@
 
 # the ino -> cpp -> o file