refactor build system for docs
authorDavid Schleef <ds@schleef.org>
Sat, 16 Aug 2003 00:20:02 +0000 (00:20 +0000)
committerDavid Schleef <ds@schleef.org>
Sat, 16 Aug 2003 00:20:02 +0000 (00:20 +0000)
doc/Makefile.am
doc/comedilib.sgml
doc/html/Makefile.am [new file with mode: 0644]
doc/html/acq-seq.gif [new file with mode: 0644]
doc/man/Makefile.am [new file with mode: 0644]

index c0fba513d30e9dd1cf7234de2c1270a49474bea7..808527bf5bf3ca775ac980e247101c320402a04c 100644 (file)
@@ -1,37 +1,38 @@
 
-DOC=comedilib
+SUBDIRS = html man
+
 SGML= drivers.sgml funcref.sgml glossary.sgml \
        install.sgml intro.sgml other.sgml reference.sgml tutorial.sgml \
        driverwriting.sgml 
 
-EXTRA_DIST=$(SGML) comedilib.sgml funcref mkref drivers.txt mkdr acq-seq.gif
+BUILT_SOURCES = funcref.sgml drivers.sgml
 
-if HAVE_DOCBOOK
-all-local: html $(DOC).pdf man
+EXTRA_DIST=$(SGML) comedilib.sgml funcref mkref drivers.txt mkdr acq-seq.gif
 
-install-data-local:
-       $(INSTALL) -d $(mandir)/man3
-       -$(INSTALL_DATA) man/*.3 $(mandir)/man3
-       $(INSTALL) -d $(pkgdatadir)/html
-       $(INSTALL_DATA) html/* $(pkgdatadir)/html
+if HAVE_DOCBOOK2PDF
+all_pdf = comedilib.pdf
+install_pdf = install_pdf
 else
+all_pdf = 
+install_pdf = 
 endif
 
-clean-local:
-       rm -rf comedilib.pdf drivers.sgml funcref.sgml
-       rm -rf html man
+all-local: $(all_pdf)
 
-locales = de
+install-data-local: $(install_pdf)
 
-$(DOC).pdf: $(DOC).sgml $(SGML)
-       $(JW_PATH) -f docbook -b pdf $(DOC).sgml
+install_pdf:
+       $(INSTALL) -d $(pkgdatadir)
+       $(INSTALL_DATA) comedilib.pdf $(pkgdatadir)
 
-html: $(DOC).sgml $(SGML)
-       { $(JW_PATH) -f docbook -b html -o html $(DOC).sgml && touch html; } || { $(RM) -r html; exit 1; }
-       ln -sf ../acq-seq.gif html/acq-seq.gif
+uninstall-local:
+       rm -f $(pkgdatadir)/comedilib.pdf
 
-man: $(DOC).sgml $(SGML)
-       -{ $(JW_PATH) -f docbook -b man -o man $(DOC).sgml && touch man; } || { $(RM) -r man; exit 1; }
+clean-local:
+       rm -f comedilib.pdf drivers.sgml funcref.sgml
+
+comedilib.pdf: $(srcdir)/comedilib.sgml $(SGML)
+       $(DOCBOOK2PDF) -f docbook -b pdf $(srcdir)/comedilib.sgml
 
 funcref.sgml: funcref mkref
        ./mkref funcref >funcref.sgml
@@ -39,8 +40,10 @@ funcref.sgml: funcref mkref
 drivers.sgml: drivers.txt mkdr
        ./mkdr drivers.txt >drivers.sgml
 
+locales = de
+
 messages: .phony
-       xgettext -k_ -k_s $(shell find .. -name '*.c')
+       xgettext -k_ -k_s `find .. -name '*.c'`
        for i in $(locales);do \
          msgmerge po/$$i.po messages.po -o $$i.po; \
          mkdir -p locale/$$i/LC_MESSAGES; \
index 0d9ec8ca44030d98c5d2019846749cd86ae71978..59e14c6078a52c0450742c565784e2e852c84bda 100644 (file)
@@ -9,6 +9,8 @@
 <!ENTITY funcref SYSTEM "funcref.sgml">
 <!ENTITY glossary SYSTEM "glossary.sgml">
 <!ENTITY comedi "<acronym>Comedi</acronym>">
+<!ENTITY uuml "u">
+<!ENTITY hellip "...">
 ]>
 
 <article>
diff --git a/doc/html/Makefile.am b/doc/html/Makefile.am
new file mode 100644 (file)
index 0000000..2bf2207
--- /dev/null
@@ -0,0 +1,32 @@
+
+EXTRA_DIST = acq-seq.gif
+
+if HAVE_DOCBOOK2HTML
+all_html = all_html
+install_html = install_html
+uninstall_html = uninstall_html
+else
+all_html = 
+install_html = 
+uninstall_html = 
+endif
+
+all-local: $(all_html)
+
+all_html: $(srcdir)/../comedilib.sgml $(SGML)
+       $(DOCBOOK2HTML) $(srcdir)/../comedilib.sgml
+
+install-data-local: $(install_html)
+
+install_html:
+       $(INSTALL) -d $(pkgdatadir)/html
+       for each in *.html $(srcdir)/*.gif ; do $(INSTALL_DATA) $$each $(pkgdatadir)/html ; done
+
+uninstall-local: $(uninstall_html)
+
+uninstall_html:
+       for each in *.html $(srcdir)/*.gif ; do rm $(pkgdatadir)/html/`basename $$each` ; done
+
+clean-local:
+       rm -rf *.html
+
diff --git a/doc/html/acq-seq.gif b/doc/html/acq-seq.gif
new file mode 100644 (file)
index 0000000..717a0e5
Binary files /dev/null and b/doc/html/acq-seq.gif differ
diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
new file mode 100644 (file)
index 0000000..8741ac9
--- /dev/null
@@ -0,0 +1,31 @@
+
+if HAVE_DOCBOOK2MAN
+all_man = all_man
+install_man = install_man
+uninstall_man = uninstall_man
+else
+all_man = 
+install_man = 
+uninstall_man = 
+endif
+
+all-local: $(all_man)
+
+all_man: $(srcdir)/../comedilib.sgml $(SGML)
+       $(DOCBOOK2MAN) $(srcdir)/../comedilib.sgml
+
+install-data-local: $(install_man)
+
+install_man:
+       $(INSTALL) -d $(mandir)/man3
+       for each in *.3 ; do $(INSTALL_DATA) $$each $(mandir)/man3 ; done
+
+uninstall-local: $(uninstall_man)
+
+uninstall_man:
+       for each in *.3 ; do rm $(mandir)/man3/$$each ; done
+
+clean-local:
+       rm -f *.3
+       rm -f manpage.links manpage.refs
+