forked from lsh123/xmlsec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
130 lines (113 loc) · 3.8 KB
/
Makefile.am
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
NULL =
SUBDIRS=api
TARGET_DIR=@XMLSEC_DOCDIR@
# we copy over all folders to builddir to make it easier to test docs
EXTRA_DIST=\
$(builddir)/images \
$(builddir)/css \
$(builddir)/*.html \
$(builddir)/*.ico \
$(builddir)/xmlsec.xsl \
$(builddir)/xmlsec-ga.xsl \
$(NULL)
XMLSEC1_MAN=$(top_builddir)/man/xmlsec1.1
XMLSEC_HTML=$(builddir)/xmlsec-man.html
all:
@echo "======= Run 'make docs' in the xmlsec/docs folder to rebuild docs"
# docs is legacy
docs: docs-copy man-docs docs-format
docs-copy:
@( \
echo "Copying docs..."; \
if [ z"$(srcdir)" != z"$(builddir)" -a z"`uname`" != z"Darwin" ]; \
then \
$(CP) -ru $(srcdir)/*.html $(srcdir)/*.ico $(srcdir)/images $(srcdir)/css $(builddir)/ ; \
(chmod u+w $(builddir)/*.html || true) ; \
(chmod u+w $(builddir)/*.ico || true) ; \
(chmod -R u+w $(builddir)/images || true) ; \
(chmod -R u+w $(builddir)/css || true) ; \
fi \
)
# if we build docs then we also have xsltproc
if BUILD_MAN_DOCS
man-docs: $(XMLSEC_HTML) docs-copy
$(XMLSEC_HTML): docs-copy $(XMLSEC1_MAN)
$(MAN2HTML) $(XMLSEC1_MAN) | \
grep -v '^Content-type: text/html' | \
tr "[:cntrl:]" " " > \
$(XMLSEC_HTML)
else
# do nothing, we aready copied this file
man-docs:
endif
if HAS_XSLTPROC
docs-format: docs-copy man-docs
@(echo "Formatting html documents"; \
for i in `find $(builddir) -name "*.html" -print`; \
do \
top_folder=`echo $$i | sed 's#/[^/]*$$#/#' | sed 's#\./##' | \
sed 's#[^/]*/#../#g'`; \
echo "Processing $$i (topfolder='$$top_folder')"; \
$(XSLTPROC) --html --stringparam topfolder "$$top_folder" \
--output $$i.tmp $(srcdir)/xmlsec.xsl $$i; \
if [ $$? != 0 ]; \
then \
echo "ERROR: processing file $$i"; \
exit 1; \
fi; \
mv $$i.tmp $$i; \
done)
@(echo "Cleaning html documents"; \
for i in `find $(builddir) -name "*.html" -print`; \
do \
echo Cleaning $$i ; \
sed 's/\xA0/ /g' $$i > $$i.tmp ; \
mv $$i.tmp $$i ; \
done)
docs-format-ga:
@(echo "Formatting html documents to add Google Analytics"; \
for i in `find $(builddir) -name "*.html" -print`; \
do \
echo "Processing $$i"; \
$(XSLTPROC) --html --output $$i.tmp $(srcdir)/xmlsec-ga.xsl $$i; \
if [ $$? != 0 ]; \
then \
echo "ERROR: processing file $$i"; \
exit 1; \
fi; \
mv $$i.tmp $$i; \
done)
else
# do nothing
docs-format: docs-copy man-docs
endif
clean-local:
-rm -f *.stamp
( if [ z"$(srcdir)" != z"$(builddir)" ] ; then \
(chmod -R u+w $(builddir)/images || true) && rm -rf $(builddir)/images ; \
(chmod -R u+w $(builddir)/css || true) && rm -rf $(builddir)/css ; \
(chmod -R u+w $(builddir)/src || true) && rm -rf $(builddir)/src ; \
(for i in `find $(builddir) -name "*.html" -print` ; do \
echo "Removing files '$$i' ... " ; \
chmod -R u+w $$i && rm -f $$i ; \
done ) ; \
(for i in `find $(builddir) -name "*.ico" -print` ; do \
echo "Removing files '$$i' ... " ; \
chmod -R u+w $$i && rm -f $$i ; \
done ) ; \
fi ; )
distclean-local: clean-local
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)/images
$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)/css
$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)/api
$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)/api/images
-@INSTALL@ -m 0644 $(builddir)/*.html $(DESTDIR)$(TARGET_DIR)
-@INSTALL@ -m 0644 $(builddir)/*.ico $(DESTDIR)$(TARGET_DIR)
-@INSTALL@ -m 0644 $(builddir)/images/*.gif $(builddir)/images/*.png $(DESTDIR)$(TARGET_DIR)/images
-@INSTALL@ -m 0644 $(builddir)/css $(DESTDIR)$(TARGET_DIR)/css
-@INSTALL@ -m 0644 $(builddir)/api/*.html $(builddir)/api/*.png $(builddir)/api/*.sgml $(DESTDIR)$(TARGET_DIR)/api
-@INSTALL@ -m 0644 $(builddir)/api/images/*.png $(DESTDIR)$(TARGET_DIR)/api/images
uninstall-local:
@rm -rf $(DESTDIR)$(TARGET_DIR)