From 705a1e4a7ccf890f07c5c1fefd529710f5bcba15 Mon Sep 17 00:00:00 2001 From: Benny Baumann <BenBE@geshi.org> Date: Tue, 1 Oct 2019 00:17:58 +0200 Subject: [PATCH] fix: Proper recursive directory listing --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 287d8f4..bc1b9db 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,9 @@ POTDIR ?= po/tpl PODIR ?= po/lang MODIR ?= po/bin -SOURCES := $(wildcard ${SRCDIR}/*.cpp) $(wildcard ${SRCDIR}/*.c) $(wildcard ${SRCDIR}/**/*.cpp) $(wildcard ${SRCDIR}/**/*.c) +rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) + +SOURCES := $(call rwildcard,${SRCDIR},*.cpp *.c) SRCOBJS := $(patsubst ${SRCDIR}/%.c,${OBJDIR}/%.o,$(patsubst ${SRCDIR}/%.cpp,${OBJDIR}/%.o,${SOURCES})) @@ -53,7 +55,7 @@ OBJECTS := $(filter-out $(patsubst ${SRCDIR}/%,${OBJDIR}/%,${APPDIR})/%,${SRCOBJ TARGETS := $(patsubst $(patsubst ${SRCDIR}/%,${OBJDIR}/%,${APPDIR})/%.o,${BINDIR}/%,${APPOBJS}) -POTSRCS := ${SOURCES} $(wildcard ${SRCDIR}/*.hpp) $(wildcard ${SRCDIR}/*.h) $(wildcard ${SRCDIR}/**/*.hpp) $(wildcard ${SRCDIR}/**/*.h) +POTSRCS := ${SOURCES} $(call rwildcard,${SRCDIR},*.hpp *.h) POTOBJS := ${POTDIR}/${PODOMAIN}.pot POOBJS := $(foreach POLANG,${POLANGS},$(patsubst ${POTDIR}/%.pot,${PODIR}/${POLANG}/%.po,${POTOBJS})) MOOBJS := $(patsubst ${PODIR}/%.po,${MODIR}/%.mo,${POOBJS}) -- GitLab