summaryrefslogtreecommitdiffstats
path: root/developer-doc/phb/Makefile.am
blob: f3024e5fa83c71457e4bc19d09b9ec566b723e8f (plain)
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
KDE_OPTIONS = noautodist

DOCBOOK_FILES = phb.docbook cfg-mgmt.docbook coding.docbook cvs-examples.docbook  src-examples.docbook licence.docbook error-mgmt.docbook unit-test.docbook rel-mgmt.docbook test-examples.docbook rpm-example.docbook fdl-licence translation.docbook dialogs.docbook documentation.docbook settings.docbook submissions.docbook

EXTRA_DIST = $(DOCBOOK_FILES)

MOSTLYCLEANFILES = *.html *.pdf *.ps phb.docbook.tex online-phb.tar.bz2

TARGETS = phb.html

if GENERATE_PDF
PDF_TARGET = kmymoney-phb.pdf
endif

.PHONY: all show preview get-files clear-files web
all:	$(TARGETS) $(PDF_TARGET)

STYLESHEET = tde-nochunk.xsl

phb.html:	$(DOCBOOK_FILES)
	@if test -e $(MEINPROC); then \
		$(MEINPROC) --stylesheet $(kde_libs_prefix)/share/apps/ksgmltools2/customization/$(STYLESHEET) $(srcdir)/phb.docbook --stdout | \
		iconv -f ISO-8859-1 -t UTF-8 | \
		sed "s/ISO-8859-1/UTF-8/g" > phb.html; \
	fi

preview: phb.html

show: preview
	konqueror phb.html

# if we're in a VPATH environment, we need to copy all files over
# to the build directory. Otherwise, we'll get into trouble. Of course
# we delete them afterwards.
get-files:
	if test -n "$(VPATH)" ; then \
		if test x$(VPATH) != x.; then \
			for file in $(DOCBOOK_FILES) $(SCREENSHOT_FILES); do \
				cp $(srcdir)/$$file .; \
				chmod +w $$file; \
			done; \
		fi \
	fi

clear-files:
	if test -n "$(VPATH)" ; then \
		if test x$(VPATH) != x.; then \
			for file in $(DOCBOOK_FILES) $(SCREENSHOT_FILES); do chmod +w $$file; rm $$file; done;  \
		fi \
	fi


web: phb/index.html

phb/index.html: $(DOCBOOK_FILES)
	if test -x $(abs_top_srcdir)/contrib/splitup-kde-chunk-online; then \
		rm -rf phb common; \
		mkdir phb; \
		mkdir common; \
		$(MEINPROC) --stylesheet `dirname $(KDE_XSL_STYLESHEET)`/tde-chunk-online.xsl  $(srcdir)/phb.docbook -o phb/index.xml; \
		cd phb; \
		$(abs_top_srcdir)/contrib/splitup-kde-chunk-online; \
		rm index.xml; \
		cd ..; \
		make get-files; \
		for file in $(SCREENSHOT_FILES); do \
			cp $$file phb; \
		done; \
		make clear-files; \
		cp $(kde_libs_htmldir)/en/common/* common; \
		if test ! -z "$(PDF_TARGET)"; then \
			cp $(PDF_TARGET) phb; \
		fi; \
	fi;

sf-username:
	@if test -z $(SF_USER); then \
		echo "The environment variable SF_USER must be set to your"; \
		echo "SourceForge username and you must have write access"; \
		echo "to the project space before the upload will work."; \
		exit 1; \
	fi;


web-upload: sf-username web
	if test -e common; then \
		echo "cd htdocs/common" > upload.batch; \
		echo "rm *" >> upload.batch; \
		echo lcd common >> upload.batch; \
		echo "mput *" >> upload.batch; \
		echo cd ../phb >> upload.batch; \
		echo "rm *" >> upload.batch; \
		echo lcd ../phb >> upload.batch; \
		echo "mput *" >> upload.batch; \
		echo "rm index.xml"; \
		echo "Uploading prject handbook files to web.sourceforge.net"; \
		sftp -b upload.batch $(SF_USER),kmymoney2@web.sourceforge.net; \
		rm -rf upload.batch; \
	fi;

# if we're in a VPATH environment, we need to copy all files over
# to the build directory. Otherwise, we'll get into trouble. Of course
# we delete them afterwards.

if GENERATE_PDF
kmymoney-phb.pdf: $(DOCBOOK_FILES)
	$(MAKE) get-files
	$(MEINPROC) --stylesheet `dirname $(KDE_XSL_STYLESHEET)`/tde-nochunk.xsl $(srcdir)/phb.docbook -o index.html
	html2ps -o kmymoney-phb.ps -n index.html
	ps2pdf kmymoney-phb.ps kmymoney-phb.pdf
	rm index.html kmymoney-phb.ps
	$(MAKE) clear-files
endif