Fix build of blueprints in Makefile 13/713/1
authorCarlos Goncalves <carlos.goncalves@neclab.eu>
Tue, 2 Jun 2015 09:32:39 +0000 (11:32 +0200)
committerCarlos Goncalves <carlos.goncalves@neclab.eu>
Tue, 2 Jun 2015 09:32:39 +0000 (11:32 +0200)
JIRA: DOCTOR-4

Change-Id: Ie62751f6631c48c4dfecc869d5d95daaf6a1754f
Signed-off-by: Carlos Goncalves <carlos.goncalves@neclab.eu>
Makefile

index 9095346..884c0fe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,26 @@
-BUILDDIR = build
+BUILDDIR := build
 DESIGN_DOCS = $(wildcard design_docs/*.rst)
 
-.PHONY: clean html pdf all
+.PHONY: clean html pdf bps all
 
-all: html pdf
+all: bps html pdf
 
 clean:
        rm -rf $(BUILDDIR)/*
 
-html: $(DESIGN_DOCS)
-       mkdir -p build/design_docs
-       rst2html.py $^ $(BUILDDIR)/$(^:.rst=.html)
+bps: $(DESIGN_DOCS) | $(BUILDDIR)
+       mkdir -p $(BUILDDIR)/design_docs
+       $(foreach f,$(DESIGN_DOCS),rst2html.py $(f) $(BUILDDIR)/$(f:.rst=.html);)
+
+html: | $(BUILDDIR)
        sphinx-build -b html -c etc -d $(BUILDDIR)/doctrees \
            requirements $(BUILDDIR)/requirements/html
 
-pdf:
+pdf: | $(BUILDDIR)
        sphinx-build -b latex -c etc -d $(BUILDDIR)/doctrees \
            requirements $(BUILDDIR)/requirements/latex
        $(MAKE) -C $(BUILDDIR)/requirements/latex \
            LATEXOPTS='--interaction=nonstopmode' all-pdf
+
+$(BUILDDIR):
+       mkdir -p $(BUILDDIR)