198
198
TARGET := $(if $(TARGET),$(TARGET),a.out)
199
199
OBJECTS := $(addsuffix .o, $(basename $(SOURCES)))
200
DEPFILES := $(patsubst %, .dep/%.dep, $(SOURCES))
201
200
ARDUINOCOREDIR := $(ARDUINODIR)/hardware/arduino/cores/arduino
202
201
ARDUINOLIB := .lib/arduino.a
203
202
ARDUINOLIBLIBSDIR := $(ARDUINODIR)/libraries
248
CPPFLAGS := -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections
249
CPPFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
250
CPPFLAGS += -mmcu=$(BOARD_BUILD_MCU)
251
CPPFLAGS += -DF_CPU=$(BOARD_BUILD_FCPU) -DARDUINO=$(ARDUINOCONST)
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))
256
CPPDEPFLAGS = -MMD -MP -MF .dep/$<.dep
257
CPPINOFLAGS := -x c++ -include $(ARDUINOCOREDIR)/Arduino.h
247
CPPFLAGS_S := -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections
248
CPPFLAGS_S += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
249
CPPFLAGS_S += -mmcu=$(BOARD_BUILD_MCU)
250
CPPFLAGS_S += -DF_CPU=$(BOARD_BUILD_FCPU) -DARDUINO=$(ARDUINOCONST)
251
CPPFLAGS_S += -I. -Iutil -Iutility -I$(ARDUINOCOREDIR)
252
CPPFLAGS_S += -I$(ARDUINODIR)/hardware/arduino/variants/$(BOARD_BUILD_VARIANT)/
253
CPPFLAGS_S += $(addprefix -I$(ARDUINODIR)/libraries/, $(LIBRARIES))
254
CPPFLAGS_S += $(patsubst %, -I$(ARDUINODIR)/libraries/%/utility, $(LIBRARIES))
255
CPPFLAGS = $(CPPFLAGS_S)
258
256
AVRDUDEFLAGS := $(addprefix -C , $(AVRDUDECONF)) -DV
259
257
AVRDUDEFLAGS += -p $(BOARD_BUILD_MCU) -P $(SERIALDEV)
260
258
AVRDUDEFLAGS += -c $(BOARD_UPLOAD_PROTOCOL) -b $(BOARD_UPLOAD_SPEED)
326
319
$(TARGET).elf: $(ARDUINOLIB) $(OBJECTS)
327
320
$(CC) $(LINKFLAGS) $(OBJECTS) $(ARDUINOLIB) -o $@
330
mkdir -p .dep/$(dir $<)
331
$(COMPILE.c) $(CPPDEPFLAGS) -o $@ $<
334
mkdir -p .dep/$(dir $<)
335
$(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ $<
338
mkdir -p .dep/$(dir $<)
339
$(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ $<
342
mkdir -p .dep/$(dir $<)
343
$(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ $<
323
# $(COMPILE.c) -o $@ $<
346
mkdir -p .dep/$(dir $<)
347
$(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ $(CPPINOFLAGS) $<
326
$(COMPILE.cpp) -o $@ -x c++ -include $(ARDUINOCOREDIR)/Arduino.h $<
350
mkdir -p .dep/$(dir $<)
351
$(COMPILE.cpp) $(CPPDEPFLAGS) -o $@ -x c++ -include $(ARDUINOCOREDIR)/Arduino.h $<
329
$(COMPILE.cpp) -o $@ -x c++ -include $(ARDUINOCOREDIR)/Arduino.h $<
353
331
# building the arduino library