]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Makefile: Clean up directory creation.
authorAndre Noll <maan@systemlinux.org>
Sun, 22 Jul 2012 14:33:20 +0000 (16:33 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 27 Aug 2012 11:01:05 +0000 (13:01 +0200)
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
m4/gengetopt/makefile

index 3463553c15800ae6fd9917ef1e11701a3d038425..47c52ff5ef625d45907d030eed82df635a9a3715 100644 (file)
@@ -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)/*
index 8b0c1f8dc0fd79def4642f7513f38029da230d00..05b31975f3e9d16e8bfbaf6eb7c5b12546dfafba 100644 (file)
@@ -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 $<'