From 48f044112f8bcb2302366848a4d1ea0da9b73a35 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 22 Jul 2012 16:33:20 +0200 Subject: [PATCH] Makefile: Clean up directory creation. This combines all directory targets into a single target and executes the contents of the new MKDIR_P variable (set to "mkdir -p") to create the directory. --- Makefile.in | 17 +++++++---------- m4/gengetopt/makefile | 2 -- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3463553c..47c52ff5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -12,6 +12,7 @@ executables := @executables@ GENGETOPT := @gengetopt@ HELP2MAN := @help2man@ +MKDIR_P := mkdir -p build_date := $(shell date) uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS") @@ -103,6 +104,9 @@ dep: $(deps) man: $(man_pages) tarball: $(tarball) +$(object_dir) $(man_dir) $(ggo_dir) $(cmdline_dir): + $(Q) $(MKDIR_P) $@ + -include $(m4_ggo_dir)/makefile # When in doubt, use brute force (Ken Thompson) @@ -143,13 +147,6 @@ man/man1/%.1: % | $(man_dir) @[ -z "$(Q)" ] || echo 'MAN $<' $(Q) $(HELP2MAN) -h --detailed-help -N ./$< > $@ -$(object_dir): - mkdir -p $@ -$(man_dir): - mkdir -p $@ -$(ggo_dir): - mkdir -p $@ - $(object_dir)/crypt.o: crypt.c | $(object_dir) @[ -z "$(Q)" ] || echo 'CC $<' $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @openssl_cppflags@ $< @@ -303,16 +300,16 @@ maintainer-clean: distclean rm -rf web_sync install: all man - mkdir -p $(BINDIR) $(MANDIR) + $(MKDIR_P) $(BINDIR) $(MANDIR) $(install_sh) -s -m 755 @executables@ $(BINDIR) $(install_sh) -m 644 $(man_pages) $(MANDIR) - mkdir -p $(VARDIR) >/dev/null 2>&1 || true # not fatal, so don't complain + $(MKDIR_P) $(VARDIR) >/dev/null 2>&1 || true # not fatal, so don't complain $(tarball): rm -rf $(tarball_pfx).tar.bz2 $(tarball_pfx) git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \ | tar --delete $(tarball_delete) > $(tarball_pfx).tar - mkdir -p $(tarball_pfx) + $(MKDIR_P) $(tarball_pfx) ./GIT-VERSION-GEN > $(tarball_pfx)/VERSION cp -r $(autocrap) $(tarball_pfx) tar rf $(tarball_pfx).tar $(tarball_pfx)/* diff --git a/m4/gengetopt/makefile b/m4/gengetopt/makefile index 8b0c1f8d..05b31975 100644 --- a/m4/gengetopt/makefile +++ b/m4/gengetopt/makefile @@ -1,6 +1,4 @@ module_ggo_opts := --set-version="($(PACKAGE_STRING), $(codename))" -$(cmdline_dir): - mkdir -p $(cmdline_dir) $(cmdline_dir)/%_recv.cmdline.h $(cmdline_dir)/%_recv.cmdline.c: $(ggo_dir)/%_recv.ggo | $(cmdline_dir) @[ -z "$(Q)" ] || echo 'GGO $<' -- 2.39.5