fix haddock submodule pointer
[ghc-hetmet.git] / mk / install.mk.in
1 #                                                                -*-makefile-*-
2 # @configure_input@
3 #
4 ################################################################################
5 #
6 # install.mk.in
7 #
8 # This file sets up the installation directories.
9 #
10 # DO NOT EDIT THIS FILE!
11 #
12 #       - install.mk is auto-generated from install.mk.in by configure.
13 #         If you edit install.mk your changes will be spammed.
14 #
15 #       - Settings in this file may be overriden by giving replacement
16 #         definitions in build.mk.
17
18 # Definition of installation directories, we don't use half of these, but since
19 # the configure script has them on offer while passing through, we might as well
20 # set them. Note that we have to be careful, because the GNU coding standards
21 # have changed a bit over the course of time, and autoconf development reflects
22 # this.
23 #
24 # A little bit of history regarding autoconf and GNU coding standards, use this
25 # as a cheat-sheet for the stuff below:
26 #
27 # variable    | default < 2.60     | default >= 2.60
28 # ------------+--------------------+--------------------------------------
29 # exec_prefix | ${prefix}          | ${prefix}
30 # libdir      | ${exec_prefix}/lib | ${exec_prefix}/lib
31 # datarootdir | NONE!              | ${prefix}/share
32 # datadir     | ${prefix}/share    | ${datarootdir}
33 # infodir     | ${prefix}/info     | ${datarootdir}/info
34 # mandir      | ${prefix}/man      | ${datarootdir}/man
35 # docdir      | NONE!              | ${datarootdir}/doc/${PACKAGE_TARNAME}
36 # htmldir     | NONE!              | ${docdir}
37 # dvidir      | NONE!              | ${docdir}
38 # pdfdir      | NONE!              | ${docdir}
39 # psdir       | NONE!              | ${docdir}
40 #
41 # NOTE: The default e.g. ${docdir} above means that autoconf substitutes the
42 # string "${docdir}", not the value of docdir! This is crucial for the GNU
43 # coding standards.
44
45 define set_default
46 # $1 = variable to set
47 # $2 = default value to use, if configure didn't expand it
48 # If $1 starts with an @ then configure didn't set it (because a version
49 # of autoconf that is too old was used), so set it to a sensible value
50 ifneq "$$(filter @%,$$($1))" ""
51 $1 = $2
52 endif
53 endef
54
55 # This gets used in the default docdir when autoconf >= 2.60 is used
56 PACKAGE_TARNAME = @PACKAGE_TARNAME@
57
58 prefix          = @prefix@
59
60 datarootdir = @datarootdir@
61 $(eval $(call set_default,datarootdir,$${prefix}/share))
62
63 exec_prefix     = @exec_prefix@
64 bindir          = @bindir@
65 datadir         = @datadir@
66 libdir          = @libdir@
67 includedir      = @includedir@
68 mandir          = @mandir@
69
70 docdir = @docdir@
71 $(eval $(call set_default,docdir,$${datarootdir}/doc/ghc))
72
73 htmldir = @htmldir@
74 dvidir  = @dvidir@
75 pdfdir  = @pdfdir@
76 psdir   = @psdir@
77 $(eval $(call set_default,htmldir,$${docdir}))
78 $(eval $(call set_default,dvidir,$${docdir}))
79 $(eval $(call set_default,pdfdir,$${docdir}))
80 $(eval $(call set_default,psdir,$${docdir}))
81
82 ifeq "$(RelocatableBuild)" "YES"
83
84 # Hack: our directory layouts tend to be different on Windows, so
85 # hack around configure's bogus assumptions here.
86 datarootdir = $(prefix)
87 datadir     = $(prefix)/lib
88 libdir      = $(prefix)/lib
89
90 docdir    = $(prefix)/doc
91 htmldir   = $(docdir)
92 dvidir    = $(docdir)
93 pdfdir    = $(docdir)
94 psdir     = $(docdir)
95
96 ghclibdir = $(libdir)
97 ghcdocdir = $(datarootdir)/doc
98
99 else
100
101 # Unix: override libdir and datadir to put ghc-specific stuff in
102 # a subdirectory with the version number included.
103 #
104 # datadir is set to libdir here as GHC needs package.conf and unlit
105 # to be in the same place (and things like ghc-pkg need to agree on
106 # where package.conf is, so we just set it globally).
107 #
108 ghclibdir     = $(libdir)/ghc-$(ProjectVersion)
109 ghcdocdir     = $(datarootdir)/doc/ghc
110 endif
111
112 ghclibexecdir = $(ghclibdir)
113 topdir        = $(ghclibdir)
114 ghcheaderdir  = $(ghclibdir)/include
115
116 #-----------------------------------------------------------------------------
117 # install configuration
118
119 #
120 # Set this to have files installed with a specific owner
121 #
122 INSTALL_OWNER =
123
124
125 # Set this to have files installed with a specific group
126 #
127 INSTALL_GROUP =
128
129 #
130 # Invocations of `install' for the four different classes
131 # of targets:
132 #
133 CREATE_SCRIPT   = create () { touch "$$1" && chmod 755 "$$1" ; } && create
134 CREATE_DATA     = create () { touch "$$1" && chmod 644 "$$1" ; } && create
135 # These takes 3 arguments:
136 # $1 = flags
137 # $2 = files
138 # $3 = dest
139 INSTALL_PROGRAM = $(INSTALL) -m 755 $1 $2 $(call MK_INSTALL_DEST,$3)
140 INSTALL_SCRIPT  = $(INSTALL) -m 755 $1 $2 $(call MK_INSTALL_DEST,$3)
141 INSTALL_SHLIB   = $(INSTALL) -m 755 $1 $2 $(call MK_INSTALL_DEST,$3)
142 INSTALL_DATA    = $(INSTALL) -m 644 $1 $2 $(call MK_INSTALL_DEST,$3)
143 INSTALL_HEADER  = $(INSTALL) -m 644 $1 $2 $(call MK_INSTALL_DEST,$3)
144 INSTALL_MAN     = $(INSTALL) -m 644 $1 $2 $(call MK_INSTALL_DEST,$3)
145 INSTALL_DOC     = $(INSTALL) -m 644 $1 $2 $(call MK_INSTALL_DEST,$3)
146 # Only 1 argument, the directory to create:
147 INSTALL_DIR     = $(INSTALL) -m 755 -d $(call MK_INSTALL_DEST,$1)
148
149 # cygwin's /bin/install doesn't set file modes correctly if the
150 # destination path is a C: style path:
151 #
152 # $ /bin/install -c -m 644 foo /cygdrive/c/cygwin/home/ian/foo2
153 # $ /bin/install -c -m 644 foo c:/cygwin/home/ian/foo3
154 # $ ls -l foo*
155 # -rw-r--r-- 1 ian None 0 2011-01-06 18:28 foo
156 # -rw-r--r-- 1 ian None 0 2011-01-06 18:29 foo2
157 # -rwxrwxrwx 1 ian None 0 2011-01-06 18:29 foo3
158 #
159 # This causes problems for bindisttest/checkBinaries.sh which then
160 # thinks that e.g. the userguide HTML files are binaries.
161 #
162 # We therefore use a /cygdrive path if we are on cygwin (only)
163 #   (This will make a Cygwin build run slowly 
164 #    because of all those shell invocations.)
165 ifeq "$(OSTYPE)" "cygwin"
166 MK_INSTALL_DEST = $$(cygpath $1)
167 else
168 MK_INSTALL_DEST = $1
169 endif
170
171 #
172 # runhaskell and hsc2hs are special, in that other compilers besides
173 # GHC might provide them.  Systems with a package manager often come
174 # with tools to manage this kind of clash, e.g. RPM's
175 # update-alternatives.  When building a distribution for such a system,
176 # we recommend setting both of the following to 'YES'.
177 #
178 # NO_INSTALL_RUNHASKELL = YES
179 # NO_INSTALL_HSC2HS     = YES
180 #
181 # NB. we use negative tests here because for binary-distributions we cannot
182 # test build-time variables at install-time, so they must default to on.
183
184 ifneq "$(DESTDIR)" ""
185 override DESTDIR := $(abspath $(DESTDIR))
186 endif
187