summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2015-09-30 14:55:16 +0900
committerRyota MIBU <r-mibu@cq.jp.nec.com>2015-09-30 14:55:16 +0900
commit5d0e9caed1723bd1f8d8445bb540274af999f252 (patch)
tree46454a654329cad1388e29f1c384a37000dfed65
parent4f5c6554aa85e3516315828241270be9447f7a3e (diff)
update Makefile to create index and public dir
This patch make our review process easier by generating index file of built files. Also the following changes are included: - delete unnecessary deps in Makefile - criate new dir contains files to publish at the gate jobs JIRA: DOCTOR-45 Change-Id: Ia59b729f41f57402ce9eebe7871cbc7763cb8668 Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
-rw-r--r--.gitignore1
-rw-r--r--Makefile29
2 files changed, 22 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index 567609b1..dac82129 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
build/
+public/
diff --git a/Makefile b/Makefile
index 888d158e..1e06ef3c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,31 +1,44 @@
BUILDDIR := build
+PUBLICDIR := public
DESIGN_DOCS = $(wildcard design_docs/*.rst)
MANUALS = $(wildcard manuals/*.rst)
-.PHONY: clean html pdf bps man all
+.PHONY: clean html pdf bps man all public
+
+define index
+ rm -f $1/index.html
+ find $1 -type f | while read a; do echo "<li><a href=$${a#$1/}>$${a#$1/}</a></li>" >> $1/index.html; done
+endef
all: man bps html pdf
+ $(call index,$(BUILDDIR))
+
+public:
+ rm -rf $(PUBLICDIR)
+ mkdir -p $(PUBLICDIR)
+ cp -r $(BUILDDIR)/manuals $(PUBLICDIR)/
+ cp -r $(BUILDDIR)/design_docs $(PUBLICDIR)/
+ cp -r $(BUILDDIR)/requirements/html $(PUBLICDIR)/
+ cp -r $(BUILDDIR)/requirements/latex/*.pdf $(PUBLICDIR)/
+ $(call index,$(PUBLICDIR))
clean:
rm -rf $(BUILDDIR)/*
-man: | $(BUILDDIR)
+man:
mkdir -p $(BUILDDIR)/manuals
$(foreach f,$(MANUALS),rst2html.py $(f) $(BUILDDIR)/$(f:.rst=.html);)
-bps: $(DESIGN_DOCS) | $(BUILDDIR)
+bps: $(DESIGN_DOCS)
mkdir -p $(BUILDDIR)/design_docs
$(foreach f,$(DESIGN_DOCS),rst2html.py $(f) $(BUILDDIR)/$(f:.rst=.html);)
-html: | $(BUILDDIR)
+html:
sphinx-build -b html -c etc -d $(BUILDDIR)/doctrees \
requirements $(BUILDDIR)/requirements/html
-pdf: | $(BUILDDIR)
+pdf:
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)