1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/u8g2: improve build system integration

This commit is contained in:
Alexandre Abadie 2020-06-11 22:12:21 +02:00
parent 499ffd6339
commit 07a4d20acf
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
12 changed files with 39 additions and 38 deletions

View File

@ -5,11 +5,8 @@ PKG_LICENSE=BSD-2-Clause
include $(RIOTBASE)/pkg/pkg.mk
all:
cp src/Makefile $(PKG_BUILDDIR)/Makefile
cp src/csrc/Makefile $(PKG_BUILDDIR)/csrc/Makefile
cp src/csrc/u8x8_riotos.c $(PKG_BUILDDIR)/csrc/u8x8_riotos.c
cp src/csrc/u8x8_riotos.h $(PKG_BUILDDIR)/csrc/u8x8_riotos.h
cp src/sys/sdl/common/Makefile $(PKG_BUILDDIR)/sys/sdl/common/Makefile
cp src/sys/utf8/common/Makefile $(PKG_BUILDDIR)/sys/utf8/common/Makefile
"$(MAKE)" -C $(PKG_BUILDDIR)
all: $(filter u8g2_%,$(filter-out u8g2_csrc%, $(USEMODULE)))
"$(MAKE)" -C $(PKG_BUILDDIR)/csrc -f $(CURDIR)/Makefile.$(PKG_NAME)_csrc
u8g2_%:
"$(MAKE)" -C $(PKG_BUILDDIR)/sys/$*/common -f $(CURDIR)/Makefile.$(PKG_NAME)_$*

View File

@ -1,3 +1,6 @@
USEMODULE += xtimer
FEATURES_REQUIRED += periph_gpio
USEMODULE += u8g2_csrc_riot
USEMODULE += u8g2_csrc

View File

@ -1,9 +1,14 @@
INCLUDES += -I$(PKGDIRBASE)/u8g2/csrc
INCLUDES += -I$(RIOTBASE)/pkg/u8g2/contrib
DIRS += $(RIOTBASE)/pkg/u8g2/contrib
# The RIOT-OS interface needs this to store peripheral information.
CFLAGS += -DU8X8_WITH_USER_PTR
# Link SDL if enabled.
ifneq (,$(filter u8g2_sdl,$(USEMODULE)))
LINKFLAGS += `sdl2-config --libs`
LINKFLAGS += $(shell sdl2-config --libs)
endif
PSEUDOMODULES += u8g2

View File

@ -0,0 +1,9 @@
MODULE = u8g2_csrc
CFLAGS += -Wno-overlength-strings
ifeq (llvm,$(TOOLCHAIN))
CFLAGS += -Wno-newline-eof
endif
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,13 @@
MODULE = u8g2_sdl
CFLAGS += $(shell sdl2-config --cflags)
# Ignore warning generated when compiling this module
CFLAGS += -Wno-empty-translation-unit \
-Wno-newline-eof \
-Wno-unused-parameter \
-Wno-unused \
-Wno-overlength-strings \
-Wno-pointer-arith
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,3 @@
MODULE = u8g2_csrc_riot
include $(RIOTBASE)/Makefile.base

View File

@ -1,24 +0,0 @@
MODULE = pkg-u8g2
DIRS += csrc
# SDL can be used as a virtual display, but is for native target only.
ifneq (,$(filter u8g2_sdl,$(USEMODULE)))
DIRS += sys/sdl/common
endif
# UTF8 virtual display is not part of core. Therefore it is a separate module.
ifneq (,$(filter u8g2_utf8,$(USEMODULE)))
DIRS += sys/utf8/common
endif
# Compiling U8g2 will generate a lot of compiler warnings, which are treated
# as errors. For the sake of simplicity, ignore them.
CFLAGS += -Wno-empty-translation-unit \
-Wno-newline-eof \
-Wno-unused-parameter \
-Wno-unused \
-Wno-overlength-strings \
-Wno-pointer-arith
include $(RIOTBASE)/Makefile.base

View File

@ -1,5 +0,0 @@
MODULE = u8g2_sdl
CFLAGS += `sdl2-config --cflags`
include $(RIOTBASE)/Makefile.base