]> granicus.if.org Git - linux-pam/blobdiff - doc/Makefile
Relevant BUGIDs:
[linux-pam] / doc / Makefile
index dd2168692358a692f93c258efe16ea025ffc123e..081864ac708d17dbf9aaa54c76f3c8b5e3a590bc 100644 (file)
@@ -3,10 +3,6 @@
 
 include ../Make.Rules
 
-# These two should probably be moved into autoconf...
-DOCDIR=/usr/doc/Linux-PAM
-MANDIR=$(mandir)
-
 #######################################################
 
 FILES=pam pam_appl pam_modules
@@ -15,6 +11,7 @@ FSRCS=pam.sgml pam_appl.sgml pam_modules.sgml
 TEXTS=txts/pam.txt txts/pam_appl.txt txts/pam_modules.txt
 HTMLS=html/pam.html html/pam_appl.html html/pam_modules.html
 PSFILES=ps/pam.ps ps/pam_appl.ps ps/pam_modules.ps
+PDFFILES=pdf/pam.pdf ps/pam_appl.pdf ps/pam_modules.pdf
 
 MODULES=$(shell ls modules/*.sgml)
 
@@ -24,7 +21,11 @@ dummy:
        @echo "Making the documentation..."
        @$(MAKE) all
 
-all: htmls texts postscript
+# note, at this time we don't include pdf files by default, but you
+# can type make pdf in this directory and see what happens in the pdf
+# subdirectory.
+
+all: htmls texts postscript pdf
 
 htmls: $(HTMLS)
 
@@ -69,6 +70,19 @@ else
        @echo XXX - neither sgml2ps nor sgml2latex binaries are installed
 endif
 
+pdf: $(PDFFILES)
+
+$(PDFFILES) : $(PSFILES)
+ifeq ($(HAVE_PS2PDF),yes)
+       @for i in $(FILES) ; do \
+       if [ ! -f "pdf/$$i.pdf" ] || [ "ps/$$i.ps" -nt "ps/$$i.pdf" ]; then \
+               ps2pdf ps/$$i.ps pdf/$$i.pdf ; \
+       fi ; \
+       done
+else
+       @echo XXX - ps2pdf is not installed
+endif
+
 pam.sgml: pam_source.sgml MODULES-SGML CREDITS
        @sed -e '/^<!\-\- insert\-file MODULES\-SGML \-\->/r MODULES-SGML' pam_source.sgml | sed -e '/^<!\-\- insert\-file CREDITS \-\->/r CREDITS' > pam.sgml
 
@@ -111,6 +125,12 @@ ifneq ($(PSER),)
        for file in ps/*.ps; do \
          install -m 644 $$file $(FAKEROOT)$(DOCDIR)/ps  ; \
        done
+ifeq ($(HAVE_PS2PDF),yes)
+       mkdir -p $(FAKEROOT)$(DOCDIR)/pdf
+       for file in pdf/*.pdf; do \
+         install -m 644 $$file $(FAKEROOT)$(DOCDIR)/pdf  ; \
+       done
+endif
 endif
 ifeq ($(HAVE_SGML2HTML),yes)
        mkdir -p $(FAKEROOT)$(DOCDIR)/html
@@ -118,7 +138,8 @@ ifeq ($(HAVE_SGML2HTML),yes)
          install -m 644 $$file $(FAKEROOT)$(DOCDIR)/html ; \
        done
 endif
-       mkdir -p $(FAKEROOT)$(MANDIR)/man{3,8}
+       mkdir -p $(FAKEROOT)$(MANDIR)/man3
+       mkdir -p $(FAKEROOT)$(MANDIR)/man8
        for file in man/*.3 ; do \
          install -m 644 $$file $(FAKEROOT)$(MANDIR)/man3 ; \
        done
@@ -139,6 +160,7 @@ clean:
        rm -f man/*~
        rm -f $(TEXTS)
        rm -f $(PSFILES) ps/missfont.log
+       rm -f pdf/*.pdf
        rm -f MODULES-SGML pam.sgml
        rm -f specs/draft-morgan-pam-current.txt
        $(MAKE) -C specs/formatter clean