Makefiles: create files directory before populating it
authorW. Trevor King <wking@tremily.us>
Thu, 6 Jun 2013 22:05:12 +0000 (18:05 -0400)
committerW. Trevor King <wking@tremily.us>
Tue, 11 Jun 2013 21:42:22 +0000 (17:42 -0400)
The syntax for the rules is:

  targets ...: target-pattern: prereq-patterns | order-only-prerequisites

For details, see:

http://www.gnu.org/software/make/manual/html_node/Static-Usage.html
http://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html

Makefile

index 52e0297e8b8559bc2ec60ac2cfa9b0aab9dc2ebc..6f69e5c47dd9f31af359bb575a80b6433825ef1c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,13 +16,16 @@ distdir = catalyst-$(PACKAGE_VERSION)
 
 all: $(EXTRA_DIST)
 
-$(MAN_PAGES): files/%: doc/%.txt doc/asciidoc.conf Makefile catalyst
+files:
+       mkdir files
+
+$(MAN_PAGES): files/%: doc/%.txt doc/asciidoc.conf Makefile catalyst | files
        a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \
                 --format=manpage -D files "$<"
 
 # Additional dependencies due to inclusion
-files/catalyst.1: doc/subarches.generated.txt
-files/catalyst-spec.5: doc/subarches.generated.txt doc/targets.generated.txt
+files/catalyst.1: doc/subarches.generated.txt | files
+files/catalyst-spec.5: doc/subarches.generated.txt doc/targets.generated.txt | files
 
 doc/subarches.generated.txt: $(wildcard catalyst/arch/*.py) doc/make_subarch_table_guidexml.py
        ./doc/make_subarch_table_guidexml.py
@@ -30,7 +33,7 @@ doc/subarches.generated.txt: $(wildcard catalyst/arch/*.py) doc/make_subarch_tab
 doc/targets.generated.txt: doc/make_target_table.py $(wildcard catalyst/targets/*.py)
        "./$<" > "$@"
 
-$(DOCS): files/%.html: doc/%.txt doc/asciidoc.conf Makefile
+$(DOCS): files/%.html: doc/%.txt doc/asciidoc.conf Makefile | files
        a2x --conf-file=doc/asciidoc.conf --attribute="catalystversion=$(PACKAGE_VERSION)" \
                 --format=xhtml -D files "$<"