-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (36 loc) · 1.62 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
XSLTPROC = /usr/bin/xsltproc
DSSSL = ../docbook-xsl/docbook.xsl
TMPDIR = $(shell mktemp -d --suffix=.tmp -p /tmp architect.html.XXXXXX)
WORKSPACE=~/workspace
PROJECT=Architect
DOCBOOK=architect
PUBLIC_HTML=~/public_html
PROJECT_DIR=$(WORKSPACE)/$(PROJECT)
HTML_DIR=$(PUBLIC_HTML)/$(DOCBOOK)
HTMLHELP_DIR=$(PUBLIC_HTML)/htmlhelp/$(DOCBOOK)/chm
all: html htmlhelp
git:
@git pull
@git submodule update --init --recursive
html: git
@mkdir -p ${HTML_DIR}
@find ${HTML_DIR} -type f -iname "*.html" -exec rm -rf {} \;
@rsync -au ../common/docbook.css $(HTML_DIR)/
@$(XSLTPROC) -o $(HTML_DIR)/ $(DSSSL) $(PROJECT_DIR)/book.xml
@$(shell test -d $(HTML_DIR)/images && find $(HTML)/images/ -type f -exec rm -rf {} \;)
@$(shell test -d images && rsync -au --exclude=.svn $(PROJECT_DIR)/images $(HTML_DIR)/)
htmlhelp:
@rm -rf $(HTMLHELP_DIR) && mkdir -p $(HTMLHELP_DIR)
@test -d $(PROJECT_DIR)/images && rsync -a images $(HTMLHELP_DIR)
@${XSLTPROC} -o $(HTMLHELP_DIR)/ --stringparam htmlhelp.chm ../$(PROJECT).chm ../docbook-xsl/htmlhelp/template.xsl book.xml
@test -f $(HTMLHELP_DIR)/htmlhelp.hhp && ../common/chm.sh $(HTMLHELP_DIR)
@iconv -f UTF-8 -t GB18030 -o $(HTMLHELP_DIR)/htmlhelp.hhp < $(HTMLHELP_DIR)/htmlhelp.hhp
@iconv -f UTF-8 -t GB18030 -o $(HTMLHELP_DIR)/toc.hhc < $(HTMLHELP_DIR)/toc.hhc
rpm:
rpmbuild -ba --sign ../Miscellaneous/package/package.spec --define "book $(DOCBOOK)"
rpm -qpi $(PUBLIC_HTML)/rpmbuild/RPMS/x86_64/netkiller-$(DOCBOOK)-*.x86_64.rpm
rpm -qpl $(PUBLIC_HTML)/rpmbuild/RPMS/x86_64/netkiller-$(DOCBOOK)-*.x86_64.rpm
clean:
rm -rf $(HTML)
test:
@$(XSLTPROC) -o $(TMPDIR)/ $(DSSSL) $(PROJECT_DIR)/book.xml