From afcb0dce4b853b7a4c1676b563199448144fbca8 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sun, 7 May 2017 17:20:57 +0000 Subject: Update: Make Makefile work again for non-DESTDIR, DESTDIR still doesn't work correctly --- webgen | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'webgen') diff --git a/webgen b/webgen index 1f58e48..e1c6b59 100755 --- a/webgen +++ b/webgen @@ -123,23 +123,18 @@ TEMPLATES=$(shell $(WEBGEN) --list) TARGETS = $(patsubst =%,%,$(filter =%,$(TEMPLATES))) $(foreach tpl,$(filter-out =%,$(TEMPLATES)),$(foreach lang,$(LANGUAGES),$(if $(findstring default,$(lang)),$(patsubst +%,%,$(tpl:~%=%)).html,$(if $(wildcard tpl/\#translate$(tpl).$(lang)),$(patsubst +%,%,$(tpl:~%=%)).$(lang).html)))) # Common phony targets: -all: prep-dirs $(TARGETS) +all: $(TARGETS) clean: rm -f $(TARGETS) new: clean all distclean: clean -prep-dirs: -ifdef DESTDIR - mkdir -vp "$(DESTDIR)" -endif - # Declare them as phony: -.PHONY: all clean new distclean prep-dirs +.PHONY: all clean new distclean # Actual rule to run webgen and calculation of all prerequisites: .SECONDEXPANSION: -$(TARGETS): prep-dirs $$(shell $(WEBGEN) --list-dependencies $$@) +$(TARGETS): $$(shell $(WEBGEN) --list-dependencies $$@) $(WEBGEN) $@ #ll @@ -243,6 +238,7 @@ do shift ;; '--destdir') + mkdir -p "$2" pushd "$2" > /dev/null OUT=`pwd` popd > /dev/null -- cgit v1.2.3