source: trunk/doc/Makefile.am @ 1263

Last change on this file since 1263 was 1263, checked in by Peter, 13 years ago

redesigning Makefile for dox generation

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.0 KB
Line 
1## Process this file with automake to produce Makefile.in
2##
3## $Id: Makefile.am 1263 2008-04-08 23:08:20Z peter $
4
5# Copyright (C) 2003 Jari Häkkinen
6# Copyright (C) 2005 Peter Johansson
7# Copyright (C) 2006 Jari Häkkinen, Peter Johansson
8# Copyright (C) 2007 2008 Peter Johansson
9#
10# This file is part of the yat library, http://trac.thep.lu.se/yat
11#
12# The yat library is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License as
14# published by the Free Software Foundation; either version 2 of the
15# License, or (at your option) any later version.
16#
17# The yat library is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, write to the Free Software
24# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25# 02111-1307, USA.
26
27DX_HTML_OUTPUT=$(srcdir)/html
28DX_LATEX_OUTPUT=$(srcdir)/latex
29
30.doxygen/variables: Makefile .doxygen doxygen.config
31  @html=`$(SED) -n 's/^[ \t]*HTML_OUTPUT[ \t]*=[ \t]*//p' doxygen.config`;\
32  if (test -z $$html); then html="html"; fi;\
33  $(ECHO) "DX_HTML_OUTPUT=$$html" > $@
34  @lt=
35  if (test -z $$lt); then lt="latex"; fi;\
36  $(ECHO) "DX_LATEX_OUTPUT=$$lt" >> $@
37  @$(ECHO) "DX_RECURSIVE="\
38  "`$(SED) -n 's/^[ \t]*RECURSIVE[ \t]*=[ \t]*//p' doxygen.config`" >> $@
39  @$(ECHO) "DX_INPUT=\
40  `$(SED) -n 's/^[ \t]*INPUT[ \t]*=[ \t]*//p' doxygen.config`" >> $@
41  @$(ECHO) "DX_FILE_PATTERN=\
42  `$(SED) -n 's/^[ \t]*FILE_PATTERNS[ \t]*=[ \t]*//p' doxygen.config`" >> $@
43
44stamp-doxygen: doxygen.config Makefile
45  @$(MAKE) $(AM_MAKEFLAGS) update-stamp-doxygen
46
47update-stamp-doxygen: FORCE
48  @input=`$(SED) -n 's/^[ \t]*INPUT[ \t]*=[ \t]*//p' doxygen.config`;\
49  pattern=\
50  `$(SED) -n 's/^[ \t]*FILE_PATTERNS[ \t]*=[ \t]*//p' doxygen.config`;\
51  if (test -z "$$pattern"); then \
52    pattern="*.c *.cc *.cxx *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp *.h++ *.idl";\
53  fi;\
54  for i in $$input; do \
55    if (test -d $$i); then \
56      for p in $$pattern; do \
57        input2="$$input2 `find $$i -name $$p|xargs`";\
58      done; \
59    else \
60      input2="$$input2 $ii"; \
61    fi; \
62  done; \
63  for i in $$input2; do \
64    if (test $$i -nt stamp-doxygen); then \
65      echo timestamp > stamp-doxygen; \
66    fi; \
67  done;
68
69if HAVE_DOXYGEN
70
71doc: html dvi ps pdf
72
73EXTRA_DIST = $(srcdir)/$(PACKAGE).dvi $(srcdir)/$(PACKAGE).ps \
74$(srcdir)/$(PACKAGE).pdf $(DX_LATEX_OUTPUT) $(DX_HTML_OUTPUT)
75
76# these are supported by automake and *-local will add target to *
77dvi-local: update-stamp-doxygen $(srcdir)/$(PACKAGE).dvi
78ps-local: update-stamp-doxygen $(srcdir)/$(PACKAGE).ps
79pdf-local: update-stamp-doxygen $(srcdir)/$(PACKAGE).pdf
80html-local: update-stamp-doxygen $(DX_HTML_OUTPUT)/index.html
81
82# this is not supported by automake - there is no target latex
83latex-local: $(DX_LATEX_OUTPUT)/refman.tex
84
85$(DX_HTML_OUTPUT)/index.html: Makefile doxygen.config stamp-doxygen
86  @(cat doxygen.config; $(ECHO) GENERATE_HTML = YES) | doxygen -;
87
88$(DX_LATEX_OUTPUT)/refman.tex: Makefile doxygen.config stamp-doxygen
89  @(cat doxygen.config; $(ECHO) GENERATE_LATEX = YES) | doxygen -;
90
91$(srcdir)/$(PACKAGE).dvi: $(DX_LATEX_OUTPUT)/refman.tex
92  cd $(DX_LATEX_OUTPUT) && latex refman.tex && latex refman.tex
93  cp $(DX_LATEX_OUTPUT)/refman.dvi $(srcdir)/$(PACKAGE).dvi
94
95$(srcdir)/$(PACKAGE).ps: $(PACKAGE).dvi
96  cd $(DX_LATEX_OUTPUT) && dvips -o refman.ps refman.dvi;
97  cp $(DX_LATEX_OUTPUT)/refman.ps $(srcdir)/$(PACKAGE).ps
98
99
100$(srcdir)/$(PACKAGE).pdf: $(DX_LATEX_OUTPUT)/refman.tex
101  cd $(DX_LATEX_OUTPUT) && $(MAKE) pdf;
102  cp $(DX_LATEX_OUTPUT)/refman.pdf $(srcdir)/$(PACKAGE).pdf
103
104endif
105
106install-data-hook:
107  @$(MAKE) $(AM_MAKEFLAGS) install-dvi install-ps install-pdf install-html
108
109uninstall-hook:
110  rm -rf $(DESTDIR)$(htmldir)/html $(DESTDIR)$(dvidir)/$(PACKAGE).dvi \
111  $(DESTDIR)$(psdir)/$(PACKAGE).ps $(DESTDIR)$(pdfdir)/$(PACKAGE).pdf
112
113install-html-am:
114  if test -d $(DX_HTML_OUTPUT); then \
115  test -d $(DESTDIR)$(htmldir)/html || \
116    $(MKDIR_P) $(DESTDIR)$(htmldir)/html;\
117  $(INSTALL_DATA) $(DX_HTML_OUTPUT)/* $(DESTDIR)$(htmldir)/html; \
118  fi
119
120install-dvi-am:
121  @if test -f "$(PACKAGE).dvi"; then \
122  test -d $(DESTDIR)$(dvidir) || $(MKDIR_P) $(DESTDIR)$(dvidir);\
123  $(INSTALL_DATA) $(srcdir)$(PACKAGE).dvi \
124   $(DESTDIR)$(dvidir)/$(PACKAGE).dvi; \
125  $(ECHO) $(INSTALL_DATA) $(PACKAGE).dvi \
126   $(DESTDIR)$(dvidir)/$(PACKAGE).dvi; \
127  fi
128
129install-ps-am:
130  @if test -f "$(PACKAGE).ps"; then \
131  test -d $(DESTDIR)$(psdir) || $(MKDIR_P) $(DESTDIR)$(psdir);\
132  $(INSTALL_DATA) $(srcdir)$(PACKAGE).ps \
133   $(DESTDIR)$(psdir)/$(PACKAGE).ps; \
134  $(ECHO) $(INSTALL_DATA) $(PACKAGE).ps $(DESTDIR)$(psdir)/$(PACKAGE).ps;\
135  fi
136
137install-pdf-am:
138  @if test -f "$(PACKAGE).pdf"; then \
139  test -d $(DESTDIR)$(pdfdir) || $(MKDIR_P) $(DESTDIR)$(pdfdir);\
140  $(INSTALL_DATA) $(srcdir)$(PACKAGE).pdf \
141   $(DESTDIR)$(pdfdir)/$(PACKAGE).pdf; \
142  $(ECHO) $(INSTALL_DATA) $(PACKAGE).pdf \
143   $(DESTDIR)$(pdfdir)/$(PACKAGE).pdf; \
144  fi
145
146
147mostlyclean-local:
148  rm -f *~
149
150clean-local:
151  rm -rf doxygen.config
152
153FORCE:
154
155
Note: See TracBrowser for help on using the repository browser.