/make/arduino-mk

To get this branch, use:
bzr branch http://bzr.ed.am/make/arduino-mk

« back to all changes in this revision

Viewing changes to arduino.mk

  • Committer: edam
  • Date: 2012-05-26 12:09:36 UTC
  • Revision ID: tim@ed.am-20120526120936-udje92i2dogga25y
updated boards goal to work on OS X (explicitly use extended REs)

Show diffs side-by-side

added added

removed removed

234
234
        $(shell sed -ne "s/$(BOARD).upload.speed=\(.*\)/\1/p" $(BOARDS_FILE))
235
235
BOARD_UPLOAD_PROTOCOL := \
236
236
        $(shell sed -ne "s/$(BOARD).upload.protocol=\(.*\)/\1/p" $(BOARDS_FILE))
237
 
BOARD_USB_VID := \
238
 
        $(shell sed -ne "s/$(BOARD).build.vid=\(.*\)/\1/p" $(BOARDS_FILE))
239
 
BOARD_USB_PID := \
240
 
        $(shell sed -ne "s/$(BOARD).build.pid=\(.*\)/\1/p" $(BOARDS_FILE))
241
237
 
242
238
# invalid board?
243
239
ifeq "$(BOARD_BUILD_MCU)" ""
253
249
CPPFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
254
250
CPPFLAGS += -mmcu=$(BOARD_BUILD_MCU)
255
251
CPPFLAGS += -DF_CPU=$(BOARD_BUILD_FCPU) -DARDUINO=$(ARDUINOCONST)
256
 
CPPFLAGS += -DUSB_VID=$(BOARD_USB_VID) -DUSB_PID=$(BOARD_USB_PID)
257
 
CPPFLAGS += -I. -Iutil -Iutility -I $(ARDUINOCOREDIR)
258
 
CPPFLAGS += -I $(ARDUINODIR)/hardware/arduino/variants/$(BOARD_BUILD_VARIANT)/
259
 
CPPFLAGS += $(addprefix -I $(ARDUINODIR)/libraries/, $(LIBRARIES))
260
 
CPPFLAGS += $(patsubst %, -I $(ARDUINODIR)/libraries/%/utility, $(LIBRARIES))
 
252
CPPFLAGS += -I. -Iutil -Iutility -I$(ARDUINOCOREDIR)
 
253
CPPFLAGS += -I$(ARDUINODIR)/hardware/arduino/variants/$(BOARD_BUILD_VARIANT)/
 
254
CPPFLAGS += $(addprefix -I$(ARDUINODIR)/libraries/, $(LIBRARIES))
 
255
CPPFLAGS += $(patsubst %, -I$(ARDUINODIR)/libraries/%/utility, $(LIBRARIES))
261
256
CPPDEPFLAGS = -MMD -MP -MF .dep/$<.dep
262
257
CPPINOFLAGS := -x c++ -include $(ARDUINOCOREDIR)/Arduino.h
263
258
AVRDUDEFLAGS := $(addprefix -C , $(AVRDUDECONF)) -DV
265
260
AVRDUDEFLAGS += -c $(BOARD_UPLOAD_PROTOCOL) -b $(BOARD_UPLOAD_SPEED)
266
261
LINKFLAGS := -Os -Wl,--gc-sections -mmcu=$(BOARD_BUILD_MCU)
267
262
 
268
 
# figure out which arg to use with stty (for OS X, GNU and busybox stty)
269
 
STTYFARG := $(shell stty --help 2>&1 | \
270
 
        grep -q 'illegal option' && echo -f || echo -F)
 
263
# figure out which arg to use with stty
 
264
STTYFARG := $(shell stty --help > /dev/null 2>&1 && echo -F || echo -f)
271
265
 
272
266
# include dependencies
273
267
ifneq "$(MAKECMDGOALS)" "clean"
331
325
.INTERMEDIATE: $(TARGET).elf
332
326
 
333
327
$(TARGET).elf: $(ARDUINOLIB) $(OBJECTS)
334
 
        $(CC) $(LINKFLAGS) $(OBJECTS) $(ARDUINOLIB) -lm -o $@
 
328
        $(CC) $(LINKFLAGS) $(OBJECTS) $(ARDUINOLIB) -o $@
335
329
 
336
330
%.o: %.c
337
331
        mkdir -p .dep/$(dir $<)