~ubuntu-branches/debian/experimental/xfdesktop4/experimental

1.4.6 by Lionel Le Folgoc
Import upstream version 4.7.4
1
SUBDIRS = \
2
	images \
3
	po
4
5
STYLESHEET = $(PACKAGE)-html.xsl
6
DOCUMENT = $(PACKAGE).xml
7
LINGUAS = $(shell cd $(srcdir)/po && echo `/bin/ls *.po | sed 's,[.]po,,g'`)
8
ALL_LINGUAS = C $(LINGUAS)
9
10
# install the html files to the destdir
11
install-data-local:
12
	for lang in $(ALL_LINGUAS); do \
13
		if test -d $(srcdir)/html/$$lang; then \
14
			dest=$(DESTDIR)$(docdir)/html/$$lang; \
15
			$(mkinstalldirs) $$dest; \
16
			installfiles=`echo $(srcdir)/html/$$lang/*`; \
17
			for file in $$installfiles; do \
18
				echo "--- Installing "$$file; \
19
				$(INSTALL_DATA) $$file $$dest; \
20
			done; \
21
			if test x"$$lang" != x"C" -a ! -d $(srcdir)/images/$$lang; then \
22
				echo "--- Creating symlink to C images for $$lang"; \
23
				ln -sf $(docdir)/html/C/images $(DESTDIR)$(docdir)/html/$$lang/images; \
24
			fi \
25
		fi \
26
	done;
27
28
# remove installed files from the destdir
29
uninstall-local:
30
	for lang in $(ALL_LINGUAS); do \
31
		dest=$(DESTDIR)$(docdir)/html/$$lang; \
32
		if test -d $$dest; then \
33
			if test -L $$dest/images; then \
34
				rm -rf $$dest; \
35
			else \
36
				rm -f $$dest/*.html; \
37
			fi \
38
		fi \
39
	done
40
41
# remove generate html from the srcdir
42
clean-local:
43
	rm -rf $(srcdir)/html
44
45
if GENERATE_DOCUMENTATION
46
47
# regenerate po(t) files
48
update-po:
49
	rm -f $(srcdir)/po/$(GETTEXT_PACKAGE).pot; \
50
	$(XML2PO) -o $(srcdir)/po/$(GETTEXT_PACKAGE).pot $(srcdir)/$(DOCUMENT); \
51
	for lang in $(LINGUAS); do \
52
		pofile=$(srcdir)/po/$$lang.po; \
53
		$(XML2PO) -u $(srcdir)/po/$$lang.po $(srcdir)/$(DOCUMENT); \
54
	done
55
56
# build the translated help files
57
doc-build.stamp: $(srcdir)/$(DOCUMENT) $(srcdir)/$(STYLESHEET)
58
	@chmod -R u+w $(srcdir); \
59
	rm -rf $(srcdir)/html; \
60
	echo; \
61
	for lang in $(ALL_LINGUAS); do \
62
		pofile=$(srcdir)/po/$$lang.po; \
63
		echo "*** Generating $$lang documentation"; \
64
		if test x"$$lang" = x"C"; then \
65
			cp $(srcdir)/$(DOCUMENT) xgen-doc; \
66
		else \
67
			echo "Building the translated DocBook XML file"; \
68
			$(XML2PO) -e -l $$lang -p $$pofile $(srcdir)/$(DOCUMENT) > xgen-doc; \
69
			rm -f .xml2po.mo; \
70
		fi; \
71
		sed -e "s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),g" \
72
			-e "s,\@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g" \
73
			-i xgen-doc; \
74
		echo "Validating DocBook XML file"; \
75
		$(XMLLINT) --noout --valid xgen-doc || exit 1; \
76
		echo "Creating the HTML pages"; \
77
		$(XSLTPROC) --nonet -o $(srcdir)/html/$$lang/ $(srcdir)/$(STYLESHEET) xgen-doc; \
78
		chmod -R u+w $(srcdir)/html/$$lang; \
79
		rm -f xgen-doc; \
80
		echo; \
81
	done; \
82
	touch doc-build.stamp
83
84
dist-check-doc: all
85
86
else
87
88
update-po:
89
	@echo "*** You need to compile with --enable-gen-doc in order to make update-po"
90
	@false
91
92
doc-build.stamp:
93
	@if test ! -d $(srcdir)/html; then \
94
		echo; \
95
		echo "*** No generated documentation found. If you want to"; \
96
		echo "*** generate the (translated) documentation, run configure"; \
97
		echo "*** with --enable-gen-doc."; \
98
		echo; \
99
	fi
100
101
dist-check-doc:
102
	@echo "*** You need to compile with --enable-gen-doc in order to make dist"
103
	@false
104
105
endif
106
107
# always try to build (if compiling with --enable-build-doc) or print
108
# a message if no html files were found in the tarball
109
all: doc-build.stamp
110
111
# include the html and man files in the dist
112
dist-hook: dist-check-doc doc-build.stamp
113
	for lang in $(ALL_LINGUAS); do \
114
		if test -d $(srcdir)/html/$$lang; then \
115
			mkdir -p $(distdir)/html/$$lang; \
116
			cp $(srcdir)/html/$$lang/* $(distdir)/html/$$lang/; \
117
		fi \
118
	done
119
120
# css file
121
cssdir = $(docdir)/html
122
css_DATA = \
123
	xfdesktop.css
124
125
EXTRA_DIST = \
126
	$(css_DATA) \
127
	$(STYLESHEET) \
128
	$(DOCUMENT)
129
130
CLEANFILES = \
131
	xgen-doc \
132
	doc-build.stamp