~ubuntu-branches/ubuntu/precise/arduino/precise

« back to all changes in this revision

Viewing changes to mjo/Arduino.mk

  • Committer: Bazaar Package Importer
  • Author(s): Scott Howard
  • Date: 2011-03-29 11:01:22 UTC
  • Revision ID: james.westby@ubuntu.com-20110329110122-geu3djqg7g0ovmqa
Tags: 0022+dfsg-3
* Moved all non-java bits to arduino-core (Closes: #613812)
* Edited Makefile to compile libraries during Makefile builds.
  - debian/patches/makefile_libraries.diff (Closes: #594191)
    Thanks to Stefan Tomanek
* debian/icons/* debian/arduino.xpm  New icons, thanks to Peter Oliver.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#         0.4  25.v.2010   M J Oldfield
32
32
#                          - tweaked reset target on Philip Hands' advice
33
33
#
 
34
#         0.5  23.iii.2011 Stefan Tomanek
 
35
#                          - added ad-hoc library building
 
36
#
34
37
########################################################################
35
38
#
36
39
# STANDARD ARDUINO WORKFLOW
73
76
#    Arduino header and footer have been affixed.
74
77
#  - any number of .c, .cpp, .s and .h files
75
78
#
 
79
# Included libraries are built in the build-cli/libs subdirectory.
76
80
#
77
81
# Besides make upload you can also
78
82
#   make            - no upload
133
137
AVRDUDE_CONF     = $(ARDUINO_ETC_PATH)/avrdude.conf
134
138
endif
135
139
 
136
 
ARDUINO_LIB_PATH  = $(ARDUINO_DIR)/hardware/libraries
 
140
ARDUINO_LIB_PATH  = $(ARDUINO_DIR)/libraries
137
141
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/arduino/cores/arduino
138
142
 
139
143
endif
169
173
endif
170
174
 
171
175
# all the objects!
172
 
OBJS            = $(LOCAL_OBJS) $(CORE_OBJS)
 
176
OBJS            = $(LOCAL_OBJS) $(CORE_OBJS) $(LIB_OBJS)
173
177
 
174
178
########################################################################
175
179
# Rules for making stuff
200
204
SYS_LIBS      = $(patsubst %,$(ARDUINO_LIB_PATH)/%,$(ARDUINO_LIBS))
201
205
SYS_INCLUDES  = $(patsubst %,-I%,$(SYS_LIBS))
202
206
SYS_OBJS      = $(wildcard $(patsubst %,%/*.o,$(SYS_LIBS)))
 
207
LIB_SRC       = $(wildcard $(patsubst %,%/*.cpp,$(SYS_LIBS)))
 
208
LIB_OBJS      = $(patsubst $(ARDUINO_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(LIB_SRC))
203
209
 
204
210
CPPFLAGS      = -mmcu=$(MCU) -DF_CPU=$(F_CPU) \
205
211
                        -I. -I$(ARDUINO_CORE_PATH) \
224
230
# file. Besides making things simpler now, this would also make it
225
231
# easy to change the build options in future
226
232
 
 
233
# library sources
 
234
$(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.cpp
 
235
        mkdir -p $(dir $@)
 
236
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
 
237
 
227
238
# normal local sources
228
239
# .o rules are for objects, .d for dependency tracking
229
240
# there seems to be an awful lot of duplication here!!!