From 0fc0ad720758950a4e993e55b64aea6369a8585d Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 12 Jun 2020 09:01:59 +0200 Subject: [PATCH] pkg/ucglib: clean build system integration And leave the original repository untouched (except for patches) --- pkg/ucglib/Makefile | 14 ++++++++------ pkg/ucglib/Makefile.dep | 2 ++ pkg/ucglib/Makefile.include | 4 +++- .../{src/csrc/Makefile => Makefile.ucglib} | 0 pkg/ucglib/Makefile.ucglib_csrc | 11 +++++++++++ pkg/ucglib/Makefile.ucglib_sdl | 14 ++++++++++++++ pkg/ucglib/contrib/Makefile | 5 +++++ pkg/ucglib/{src/csrc => contrib}/ucg_riotos.c | 0 pkg/ucglib/src/Makefile | 19 ------------------- pkg/ucglib/src/sys/sdl/dev/Makefile | 5 ----- 10 files changed, 43 insertions(+), 31 deletions(-) create mode 100644 pkg/ucglib/Makefile.dep rename pkg/ucglib/{src/csrc/Makefile => Makefile.ucglib} (100%) create mode 100644 pkg/ucglib/Makefile.ucglib_csrc create mode 100644 pkg/ucglib/Makefile.ucglib_sdl create mode 100644 pkg/ucglib/contrib/Makefile rename pkg/ucglib/{src/csrc => contrib}/ucg_riotos.c (100%) delete mode 100644 pkg/ucglib/src/Makefile delete mode 100644 pkg/ucglib/src/sys/sdl/dev/Makefile diff --git a/pkg/ucglib/Makefile b/pkg/ucglib/Makefile index 76fe1824d5..7d3239033d 100644 --- a/pkg/ucglib/Makefile +++ b/pkg/ucglib/Makefile @@ -5,9 +5,11 @@ PKG_LICENSE=BSD-2-Clause include $(RIOTBASE)/pkg/pkg.mk -all: - cp -u src/Makefile $(PKG_BUILDDIR)/Makefile - cp -u src/csrc/Makefile $(PKG_BUILDDIR)/csrc/Makefile - cp -u src/csrc/ucg_riotos.c $(PKG_BUILDDIR)/csrc/ucg_riotos.c - cp -u src/sys/sdl/dev/Makefile $(PKG_BUILDDIR)/sys/sdl/dev/Makefile - "$(MAKE)" -C $(PKG_BUILDDIR) +.PHONY: ucglib_sdl + +all: $(filter ucglib_sdl,$(USEMODULE)) + "$(MAKE)" -C $(PKG_BUILDDIR) -f $(CURDIR)/Makefile.ucglib + "$(MAKE)" -C $(PKG_BUILDDIR)/csrc -f $(CURDIR)/Makefile.ucglib_csrc + +ucglib_sdl: + "$(MAKE)" -C $(PKG_BUILDDIR)/sys/sdl/dev -f $(CURDIR)/Makefile.ucglib_sdl diff --git a/pkg/ucglib/Makefile.dep b/pkg/ucglib/Makefile.dep new file mode 100644 index 0000000000..beb31d0fac --- /dev/null +++ b/pkg/ucglib/Makefile.dep @@ -0,0 +1,2 @@ +USEMODULE += ucglib_riot +USEMODULE += ucglib_csrc diff --git a/pkg/ucglib/Makefile.include b/pkg/ucglib/Makefile.include index d6afc52d69..46fd0d7ae1 100644 --- a/pkg/ucglib/Makefile.include +++ b/pkg/ucglib/Makefile.include @@ -2,5 +2,7 @@ INCLUDES += -I$(PKGDIRBASE)/ucglib/csrc # Link SDL if enabled. ifneq (,$(filter ucglib_sdl,$(USEMODULE))) - LINKFLAGS += `sdl2-config --libs` + LINKFLAGS += $(shell sdl2-config --libs) endif + +DIRS += $(RIOTBASE)/pkg/ucglib/contrib diff --git a/pkg/ucglib/src/csrc/Makefile b/pkg/ucglib/Makefile.ucglib similarity index 100% rename from pkg/ucglib/src/csrc/Makefile rename to pkg/ucglib/Makefile.ucglib diff --git a/pkg/ucglib/Makefile.ucglib_csrc b/pkg/ucglib/Makefile.ucglib_csrc new file mode 100644 index 0000000000..7513eaa73d --- /dev/null +++ b/pkg/ucglib/Makefile.ucglib_csrc @@ -0,0 +1,11 @@ +MODULE = ucglib_csrc + +CFLAGS += -Wno-unused + +ifeq (llvm,$(TOOLCHAIN)) + CFLAGS += -Wno-misleading-indentation + CFLAGS += -Wno-unused-parameter + CFLAGS += -Wno-newline-eof +endif + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/ucglib/Makefile.ucglib_sdl b/pkg/ucglib/Makefile.ucglib_sdl new file mode 100644 index 0000000000..766bc37b01 --- /dev/null +++ b/pkg/ucglib/Makefile.ucglib_sdl @@ -0,0 +1,14 @@ +MODULE = ucglib_sdl + +# Ignore warnings generated when compiling this module. +CFLAGS += -Wno-empty-translation-unit \ + -Wno-newline-eof \ + -Wno-unused-parameter \ + -Wno-unused \ + -Wno-overlength-strings \ + -Wno-pointer-arith + +# Configure SDL2 CFLAGS +CFLAGS += $(shell sdl2-config --cflags) + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/ucglib/contrib/Makefile b/pkg/ucglib/contrib/Makefile new file mode 100644 index 0000000000..f6d90a177d --- /dev/null +++ b/pkg/ucglib/contrib/Makefile @@ -0,0 +1,5 @@ +MODULE = ucglib_riot + +CFLAGS += -Wno-unused-function + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/ucglib/src/csrc/ucg_riotos.c b/pkg/ucglib/contrib/ucg_riotos.c similarity index 100% rename from pkg/ucglib/src/csrc/ucg_riotos.c rename to pkg/ucglib/contrib/ucg_riotos.c diff --git a/pkg/ucglib/src/Makefile b/pkg/ucglib/src/Makefile deleted file mode 100644 index 62a8d91056..0000000000 --- a/pkg/ucglib/src/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -MODULE = pkg-ucglib - -DIRS += csrc - -# SDL can be used as a virtual display, but is for native target only. -ifneq (,$(filter ucglib_sdl,$(USEMODULE))) - DIRS += sys/sdl/dev -endif - -# Compiling Ucglib 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 diff --git a/pkg/ucglib/src/sys/sdl/dev/Makefile b/pkg/ucglib/src/sys/sdl/dev/Makefile deleted file mode 100644 index bc6842cac7..0000000000 --- a/pkg/ucglib/src/sys/sdl/dev/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -MODULE = ucglib_sdl - -CFLAGS += `sdl2-config --cflags` - -include $(RIOTBASE)/Makefile.base