source: projects/synaptic/trunk/xmldocs.make @ 280

Revision 280, 3.4 KB checked in by yasumichi, 13 years ago (diff)

first import

Line 
1#
2# No modifications of this Makefile should be necessary.
3#
4# To use this template:
5#     1) Define: figdir, docname, lang, omffile, and entities in
6#        your Makefile.am file for each document directory,
7#        although figdir, omffile, and entities may be empty
8#     2) Make sure the Makefile in (1) also includes
9#        "include $(top_srcdir)/xmldocs.make" and
10#        "dist-hook: app-dist-hook".
11#     3) Optionally define 'entities' to hold xml entities which
12#        you would also like installed
13#     4) Figures must go under $(figdir)/ and be in PNG format
14#     5) You should only have one document per directory
15#     6) Note that the figure directory, $(figdir)/, should not have its
16#        own Makefile since this Makefile installs those figures.
17#
18# example Makefile.am:
19#   figdir = figures
20#   docname = scrollkeeper-manual
21#   lang = C
22#   omffile=scrollkeeper-manual-C.omf
23#   entities = fdl.xml
24#   include $(top_srcdir)/xmldocs.make
25#   dist-hook: app-dist-hook
26#
27# About this file:
28#       This file was taken from scrollkeeper_example2, a package illustrating
29#       how to install documentation and OMF files for use with ScrollKeeper
30#       0.3.x and 0.4.x.  For more information, see:
31#               http://scrollkeeper.sourceforge.net/
32#       Version: 0.1.2 (last updated: March 20, 2002)
33#
34
35
36# ************* Begin of section some packagers may need to modify  **************
37# This variable (docdir) specifies where the documents should be installed.
38# This default value should work for most packages.
39# docdir = $(datadir)/@PACKAGE@/doc/$(docname)/$(lang)
40docdir = $(datadir)/gnome/help/$(docname)/$(lang)
41
42# **************  You should not have to edit below this line  *******************
43xml_files = $(entities) $(docname).xml
44
45EXTRA_DIST = $(xml_files) $(omffile)
46CLEANFILES = omf_timestamp html_timestamp
47
48# If the following file is in a subdir (like help/) you need to add that to the path
49include $(top_srcdir)/omf.make
50
51all: omf html
52
53html: html_timestamp
54
55html_timestamp:  $(docname).xml
56        rm -f $(top_builddir)/doc/html/$(lang)/*html
57        xmlto html -o  $(top_builddir)/doc/html/$(lang) --skip-validation $(srcdir)/$(docname).xml
58        mkdir -p  $(top_builddir)/doc/html/$(lang)/figures
59        cp  $(top_srcdir)/help/$(lang)/figures/*  $(top_builddir)/doc/html/$(lang)/figures
60        touch html_timestamp
61
62$(docname).xml: $(entities)
63        -ourdir=`pwd`\
64        cd $(srcdir);   \
65        cp $(entities) $$ourdir
66
67app-dist-hook: html
68        if test "$(figdir)"; then \
69          $(mkinstalldirs) $(distdir)/$(figdir); \
70          for file in $(srcdir)/$(figdir)/*.png; do \
71            basefile=`echo $$file | sed -e  's,^.*/,,'`; \
72            $(INSTALL_DATA) $$file $(distdir)/$(figdir)/$$basefile; \
73          done \
74        fi
75
76install-data-local: omf
77        $(mkinstalldirs) $(DESTDIR)$(docdir)
78        for file in $(xml_files); do \
79          cp $(srcdir)/$$file $(DESTDIR)$(docdir); \
80        done
81        if test "$(figdir)"; then \
82          $(mkinstalldirs) $(DESTDIR)$(docdir)/$(figdir); \
83          for file in $(srcdir)/$(figdir)/*.png; do \
84            basefile=`echo $$file | sed -e  's,^.*/,,'`; \
85            $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/$(figdir)/$$basefile; \
86          done \
87        fi
88
89install-data-hook: install-data-hook-omf
90
91uninstall-local: uninstall-local-doc uninstall-local-omf
92
93uninstall-local-doc:
94        -if test "$(figdir)"; then \
95          for file in $(srcdir)/$(figdir)/*.png; do \
96            basefile=`echo $$file | sed -e  's,^.*/,,'`; \
97            rm -f $(docdir)/$(figdir)/$$basefile; \
98          done; \
99          rmdir $(DESTDIR)$(docdir)/$(figdir); \
100        fi
101        -for file in $(xml_files); do \
102          rm -f $(DESTDIR)$(docdir)/$$file; \
103        done
104        -rmdir $(DESTDIR)$(docdir)
105
Note: See TracBrowser for help on using the repository browser.