source: trunk/Makemain.inc @ 3850

Last change on this file since 3850 was 3850, checked in by lou, 12 months ago

Rationalise the handling of data directories. Add/update comments.

  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
1# Copyright (C) 2006, 2007 International Business Machines and others.
2# All Rights Reserved.
3# This file is distributed under the Eclipse Public License.
4
5## $Id: Makemain.inc 3850 2018-10-11 01:13:14Z lou $
6
7# Author:  Andreas Waechter           IBM    2006-04-13
8
9
10########################################################################
11#        Variables for documentation and data directories              #
12########################################################################
13
14# Set these up to provide some uniformity in naming while also conforming
15# to Gnu directory standards. For reasons known only to the autoconf
16# developers, autoconf leaves datadir = $(datarootdir) but forces docdir
17# to $(datarootdir)/doc/$(PACKAGE_TARNAME).
18
19pkgincludedir = $(includedir)/coin-or
20pkgdatadir = $(datadir)/$(PACKAGE_TARNAME)
21pkgdocdir = $(docdir)
22
23# doxydocdir is the top-level directory for doxygen documentation. It holds
24# the tag file and possibly the PDF or Postscript version. doxyhtmldir is
25# typically a subdirectory containing all the files doxygen creates for
26# html documentation.
27
28doxydocdir = $(pkgdocdir)/doxydoc
29doxyhtmldir = $(doxydocdir)/html
30
31########################################################################
32#                    Documentation installation                        #
33########################################################################
34
35DocFiles =  README AUTHORS LICENSE
36
37COIN_HAS_DOXYGEN = @COIN_HAS_DOXYGEN_TRUE@TRUE
38COIN_HAS_LATEX = @COIN_HAS_LATEX_TRUE@TRUE
39
40# Needless to say, it's important that baredocdir_nosub not be a target for
41# autoconf substitution.
42
43DOXYTAG_EDIT = sed -e 's|@baredocdir_nosub@|$(datarootdir)/doc|g'
44
45doxygen-docs:
46        if test "$(COIN_HAS_DOXYGEN)" = TRUE; then \
47          if test -d "doxydoc/"; then \
48            if test -f doxydoc/doxygen.conf ; then \
49              $(DOXYTAG_EDIT) \
50                doxydoc/doxygen.conf > doxydoc/doxygen.conf.tmp ; \
51              mv doxydoc/doxygen.conf.tmp doxydoc/doxygen.conf ; \
52            fi ; \
53            doxygen doxydoc/doxygen.conf;\
54          fi;\
55        fi
56
57pdf-doxygen-docs: doxygen-docs
58        if test "$(COIN_HAS_DOXYGEN)" = TRUE; then \
59          if test -d "doxydoc/latex"; then \
60            if test "$(COIN_HAS_LATEX)" = TRUE; then \
61              cd doxydoc/latex;\
62              $(MAKE) pdf;\
63              cd -;\
64            fi;\
65          fi;\
66        fi
67
68clean-doxygen-docs:
69        if test -d "doxydoc"; then \
70          cd doxydoc ;\
71          rm -rf html latex *.log *.tag;\
72        fi
73
74install-doxygen-docs: doxygen-docs
75        if test "$(COIN_HAS_DOXYGEN)" = TRUE; then \
76          if test -d "doxydoc"; then \
77            test -d "$(DESTDIR)$(doxydocdir)" || \
78                 $(mkdir_p) "$(DESTDIR)$(doxydocdir)"; \
79            $(INSTALL_DATA) doxydoc/@coin_doxy_tagname@ \
80                "$(DESTDIR)$(doxydocdir)"; \
81            if test -f "doxydoc/latex/refman.pdf"; then \
82              $(INSTALL_DATA) doxydoc/latex/refman.pdf \
83                  "$(DESTDIR)$(doxydocdir)";\
84            fi;\
85            if test -d "doxydoc/html"; then \
86              test -d "$(DESTDIR)$(doxyhtmldir)/search/" || \
87                   $(mkdir_p) "$(DESTDIR)$(doxyhtmldir)/search/"; \
88              $(INSTALL_DATA) doxydoc/html/*.* \
89                  "$(DESTDIR)$(doxyhtmldir)";\
90              $(INSTALL_DATA) doxydoc/html/search/*.* \
91                  "$(DESTDIR)$(doxyhtmldir)/search";\
92            fi;\
93          fi;\
94        fi
95
96# It's not clear that uninstall-doc should also remove doxygen doc'n. Write
97# the rules so that the last one will remove pkgdocdir (which should be empty
98# by then).
99
100uninstall-doxygen-docs:
101        if test -d "$(DESTDIR)$(doxydocdir)"; then \
102          rm -rf "$(DESTDIR)$(doxydocdir)"; \
103        fi
104        rmdir $(DESTDIR)$(pkgdocdir) || true
105
106install-doc: $(DocFiles)
107        $(mkdir_p) "$(DESTDIR)$(pkgdocdir)"
108        for file in $(DocFiles); do \
109          if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
110          if test -f "$$dir$$file"; then \
111            $(INSTALL_DATA) "$$dir$$file" \
112                "$(DESTDIR)$(pkgdocdir)/$$file"; \
113          fi; \
114        done
115
116uninstall-doc:
117        for file in $(DocFiles); do \
118          rm -f "$(DESTDIR)$(pkgdocdir)/$$file"; \
119        done
120        rmdir $(DESTDIR)$(pkgdocdir) || true
121
122########################################################################
123#                         Maintainer Stuff                             #
124########################################################################
125
126if MAINTAINER_MODE
127
128# Make sure acinclude is using most recent coin.m4
129$(srcdir)/acinclude.m4: $(BUILDTOOLSDIR)/coin.m4
130        cat $(LIBTOOLM4) $< > $@
131
132# Make sure the autotools scripts are up to date
133$(AUX_DIR)/install-sh: $(BUILDTOOLSDIR)/install-sh
134        cp $< $@
135
136$(AUX_DIR)/missing: $(BUILDTOOLSDIR)/missing
137        cp $< $@
138
139$(AUX_DIR)/config.guess: $(BUILDTOOLSDIR)/config.guess
140        cp $< $@
141
142$(AUX_DIR)/config.sub: $(BUILDTOOLSDIR)/config.sub
143        cp $< $@
144
145$(AUX_DIR)/depcomp: $(BUILDTOOLSDIR)/depcomp
146        cp $< $@
147
148$(AUX_DIR)/ltmain.sh: $(BUILDTOOLSDIR)/ltmain.sh
149        cp $< $@
150
151endif
152
153.PHONY: install-doc uninstall-doc \
154        doxygen-docs pdf-doxygen-docs clean-doxygen-docs \
155        install-doxygen-docs uninstall-doxygen-docs
Note: See TracBrowser for help on using the repository browser.