-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
102 lines (82 loc) · 2.24 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
BOOK_NAME=lkn
###################################
# book section
BOOK_SRC := book.xml
CHAP_SRC := ch01.xml \
ch02.xml \
ch03.xml \
ch04.xml \
ch05.xml \
ch06.xml \
ch07.xml \
ch08.xml \
ch09.xml \
ch10.xml \
ch11.xml \
ch12.xml \
ch13.xml \
appa.xml \
appb.xml \
appc.xml \
appd.xml
all:
@echo "need to tell me what to do"
@echo "options are: clean check bookcheck html bookhtml"
clean:
-rm *.html
check:
xwf $(CHAP_SRC)
bookcheck:
xval $(BOOK_SRC)
html:
db2h $(CHAP_SRC)
bookhtml:
db2h $(BOOK_SRC)
testbookcheck:
xmllint --xinclude --postvalid --noout test_book.xml
testchaptercheck:
xmllint --dtdvalid "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" --noout $(FILES)
VERSION=$(shell date "+%Y_%m_%d"| awk '{print $$1}')
RELEASE_NAME=$(BOOK_NAME)-$(VERSION)
HTML_NAME=$(BOOK_NAME)-html-$(VERSION)
FIGURE_NAME=$(BOOK_NAME)-figures-$(VERSION)
FIGURESFILES = $(shell find . \( -not -name '.' \) -print | egrep -v '(BitKeeper|SCCS)' | grep -v "\.tar\.gz" | grep -v "\.dia" | grep figures | sort )
#HTMLFILES = $(shell find . \( -not -name '.' \) -print | egrep -v '(BitKeeper|SCCS|.git)' | grep -v "\.tar\.gz" | grep -v "\.dia" | grep html | sort )
IMAGEFILES = $(shell find -type f -name *png | sort)
HTMLFILES = $(shell ls *.html | sort )
distdir := $(RELEASE_NAME)
srcdir = .
release: clean
git-tar-tree HEAD $(RELEASE_NAME) | gzip -9v > $(RELEASE_NAME).tar.gz
@echo "Built $(RELEASE_NAME).tar.gz"
figure_release: clean
@echo $(FIGURESFILES)
#cd figures
@-rm -rf $(distdir)
@mkdir $(distdir)
@-chmod 777 $(distdir)
@for file in $(FIGURESFILES); do \
if test -d $$file; then \
mkdir $(distdir)/$$file; \
else \
cp -p $$file $(distdir)/$$file; \
fi; \
done
@tar -c $(distdir) | gzip -9 > $(FIGURE_NAME).tar.gz
@rm -rf $(distdir)
@echo "Built $(FIGURE_NAME).tar.gz"
html_release: bookhtml
@echo $(HTMLFILES) $(IMAGEFILES)
@-rm -rf $(distdir)
@mkdir $(distdir)
@-chmod 777 $(distdir)
@for file in images $(HTMLFILES) $(IMAGEFILES); do \
if test -d $$file; then \
mkdir $(distdir)/$$file; \
else \
cp -p $$file $(distdir)/$$file; \
fi; \
done
@tar -c $(distdir) | gzip -9 > $(HTML_NAME).tar.gz
@rm -rf $(distdir)
@echo "Built $(HTML_NAME).tar.gz"