|
@@ -82,6 +82,13 @@ LIQUID_TWI2 ?= 0
|
82
|
82
|
# this defines if Wire is needed
|
83
|
83
|
WIRE ?= 0
|
84
|
84
|
|
|
85
|
+# this defines if U8GLIB is needed (may require RELOC_WORKAROUND)
|
|
86
|
+U8GLIB ?= 1
|
|
87
|
+
|
|
88
|
+# this defines whether to add a workaround for the avr-gcc relocation bug
|
|
89
|
+# https://www.stix.id.au/wiki/AVR_relocation_truncations_workaround
|
|
90
|
+RELOC_WORKAROUND ?= 1
|
|
91
|
+
|
85
|
92
|
############################################################################
|
86
|
93
|
# Below here nothing should be changed...
|
87
|
94
|
|
|
@@ -273,6 +280,10 @@ endif
|
273
|
280
|
ifeq ($(NEOPIXEL), 1)
|
274
|
281
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
|
275
|
282
|
endif
|
|
283
|
+ifeq ($(U8GLIB), 1)
|
|
284
|
+VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
|
|
285
|
+VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/utility
|
|
286
|
+endif
|
276
|
287
|
|
277
|
288
|
ifeq ($(HARDWARE_VARIANT), arduino)
|
278
|
289
|
HARDWARE_SUB_VARIANT ?= mega
|
|
@@ -299,7 +310,7 @@ CXXSRC = WMath.cpp WString.cpp Print.cpp Marlin_main.cpp \
|
299
|
310
|
temperature.cpp cardreader.cpp configuration_store.cpp \
|
300
|
311
|
watchdog.cpp SPI.cpp servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \
|
301
|
312
|
dac_mcp4728.cpp vector_3.cpp least_squares_fit.cpp endstops.cpp stopwatch.cpp utility.cpp \
|
302
|
|
- printcounter.cpp nozzle.cpp serial.cpp
|
|
313
|
+ printcounter.cpp nozzle.cpp serial.cpp gcode.cpp
|
303
|
314
|
ifeq ($(NEOPIXEL), 1)
|
304
|
315
|
CXXSRC += Adafruit_NeoPixel.cpp
|
305
|
316
|
endif
|
|
@@ -315,6 +326,15 @@ SRC += twi.c
|
315
|
326
|
CXXSRC += Wire.cpp
|
316
|
327
|
endif
|
317
|
328
|
|
|
329
|
+ifeq ($(U8GLIB), 1)
|
|
330
|
+SRC += u8g_ll_api.c u8g_bitmap.c u8g_clip.c u8g_com_null.c u8g_delay.c u8g_page.c u8g_pb.c u8g_pb16h1.c u8g_rect.c u8g_state.c u8g_font.c u8g_font_data.c
|
|
331
|
+endif
|
|
332
|
+
|
|
333
|
+ifeq ($(RELOC_WORKAROUND), 1)
|
|
334
|
+LD_PREFIX=-nodefaultlibs
|
|
335
|
+LD_SUFFIX=-lm -lgcc -lc -lgcc
|
|
336
|
+endif
|
|
337
|
+
|
318
|
338
|
#Check for Arduino 1.0.0 or higher and use the correct source files for that version
|
319
|
339
|
ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
|
320
|
340
|
CXXSRC += main.cpp
|
|
@@ -493,7 +513,7 @@ extcoff: $(TARGET).elf
|
493
|
513
|
# Link: create ELF output file from library.
|
494
|
514
|
$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
|
495
|
515
|
$(Pecho) " CXX $@"
|
496
|
|
- $P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $(OBJ) $(LDFLAGS)
|
|
516
|
+ $P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
|
497
|
517
|
|
498
|
518
|
$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
|
499
|
519
|
$(Pecho) " CC $<"
|