forked from freebook/Linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (55 loc) · 1.51 KB
/
Makefile
File metadata and controls
66 lines (55 loc) · 1.51 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
XSLTPROC = /usr/bin/xsltproc
DSSSL = /home/neo/workspace/Document/Docbook/docbook-xsl/docbook.xsl
TMPDIR = $(shell mktemp -d --suffix=.tmp -p /tmp ebook.$html.XXXXXX)
DOCBOOK=''
PUBLIC_HTML=/home/neo/workspace/public_html
define reset
@mkdir -p ${PUBLIC_HTML}/$(1)
@find ${PUBLIC_HTML}/$(1) -type f -iname "*.html" -exec rm -rf {} \;
endef
define book
@rsync -au common/docbook.css $(PUBLIC_HTML)/$(2)/
@$(XSLTPROC) -o $(PUBLIC_HTML)/$(2)/ $(DSSSL) $(1)/book.xml
@$(shell test -d $(PUBLIC_HTML)/$(2)/images && find $(PUBLIC_HTML)/$(2)/images/ -type f -exec rm -rf {} \;)
@$(shell test -d $(1)/images && rsync -au --exclude=.svn $(1)/images $(PUBLIC_HTML)/$(2)/)
endef
define test
@$(XSLTPROC) -o $(TMPDIR)/ $(DSSSL) $(1)/book.xml
endef
all: linux debian monitoring storage www shell security
show:
@echo $(DOCBOOK)
@echo ${PUBLIC_HTML}
@echo $(TMPDIR)
@cat Makefile | egrep -o "(.+):" | sed 's/://'
clean:
@rm -rf $(PUBLIC_HTML)/$@
linux: clean
$(call reset,linux)
@$(XSLTPROC) -o $(PUBLIC_HTML)/$@/ $(DSSSL) book.xml
debian:
$(call reset,debian)
$(call book,System,debian)
centos:
$(call reset,centos)
$(call book,CentOS,centos)
monitoring:
$(call reset,monitoring)
$(call book,Monitoring,monitoring)
storage:
$(call reset,storage)
$(call book,Storage,storage)
www:
$(call reset,www)
$(call book,Web,www)
shell:
$(call reset,shell)
$(call book,Shell,shell)
security:
$(call reset,security)
$(call book,Security,security)
#%.html: %.xml $(DSSSL)
# $(XSLTPROC) -o $@ \
# $(DSSSL) \
# $<
test: test.html