diff --git a/Makefile.vars b/Makefile.vars index e513c92..1db9e68 100755 --- a/Makefile.vars +++ b/Makefile.vars @@ -114,9 +114,8 @@ $(eval $(call get-binary-libs,$(bin)))) # Look for their sources define get-binary-sources - SRC_$1 := $(shell find $(SRCDIR)/$1 \ - -mindepth 1 -name "*.c" \ - -printf "%P\n" | sort) + SRC_$1 := $(patsubst $(SRCDIR)/$1/%,%,$(shell find $(SRCDIR)/$1 \ + -mindepth 1 -name "*.c" | sort)) # - get the flags CFLAGS_$1 := $(CFLAGS) $(shell $(PKGCONFIG) $(LIBS_$1) --cflags 2>/dev/null) \ @@ -138,8 +137,8 @@ define check-man MAN_SECTIONS += $1 MAN_$1 += $2 endef -$(foreach doc, $(basename $(shell find $(DOCDIR) \ - -maxdepth 1 -mindepth 1 -printf "%P\n" -type f -or -type l -name "*.*.txt")), \ +$(foreach doc, $(basename $(patsubst $(DOCDIR)/%,%,$(shell find $(DOCDIR) \ + -maxdepth 1 -mindepth 1 -type f -or -type l -name "*.*.txt"))), \ $(eval $(call check-man,$(patsubst .%,%,$(suffix $(doc))),$(basename $(doc))))) # Remove duplicate sections.