Browse Source

Added support for U8G.

Marcio Teixeira 7 years ago
parent
commit
af83c512b8
1 changed files with 22 additions and 2 deletions
  1. 22
    2
      Marlin/Makefile

+ 22
- 2
Marlin/Makefile View File

82
 # this defines if Wire is needed
82
 # this defines if Wire is needed
83
 WIRE               ?= 0
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
 # Below here nothing should be changed...
93
 # Below here nothing should be changed...
87
 
94
 
273
 ifeq ($(NEOPIXEL), 1)
280
 ifeq ($(NEOPIXEL), 1)
274
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
281
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
275
 endif
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
 ifeq ($(HARDWARE_VARIANT), arduino)
288
 ifeq ($(HARDWARE_VARIANT), arduino)
278
 HARDWARE_SUB_VARIANT ?= mega
289
 HARDWARE_SUB_VARIANT ?= mega
299
 	temperature.cpp cardreader.cpp configuration_store.cpp \
310
 	temperature.cpp cardreader.cpp configuration_store.cpp \
300
 	watchdog.cpp SPI.cpp servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \
311
 	watchdog.cpp SPI.cpp servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \
301
 	dac_mcp4728.cpp vector_3.cpp least_squares_fit.cpp endstops.cpp stopwatch.cpp utility.cpp \
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
 ifeq ($(NEOPIXEL), 1)
314
 ifeq ($(NEOPIXEL), 1)
304
 CXXSRC += Adafruit_NeoPixel.cpp
315
 CXXSRC += Adafruit_NeoPixel.cpp
305
 endif
316
 endif
315
 CXXSRC += Wire.cpp
326
 CXXSRC += Wire.cpp
316
 endif
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
 #Check for Arduino 1.0.0 or higher and use the correct source files for that version
338
 #Check for Arduino 1.0.0 or higher and use the correct source files for that version
319
 ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
339
 ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
320
 CXXSRC += main.cpp
340
 CXXSRC += main.cpp
493
 	# Link: create ELF output file from library.
513
 	# Link: create ELF output file from library.
494
 $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
514
 $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
495
 	$(Pecho) "  CXX   $@"
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
 $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
518
 $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
499
 	$(Pecho) "  CC    $<"
519
 	$(Pecho) "  CC    $<"

Loading…
Cancel
Save