Kill vestiages of DEFAULT_TMPDIR
[ghc.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. See Trac #1924.
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 prefix = @prefix@
56
57 datarootdir = @datarootdir@
58 $(eval $(call set_default,datarootdir,$${prefix}/share))
59
60 exec_prefix = @exec_prefix@
61 bindir = @bindir@
62 datadir = @datadir@
63 libdir = @libdir@
64 includedir = @includedir@
65 mandir = @mandir@
66
67 # Note that `./configure --docdir=/foo/bar` should work.
68 docdir = @docdir@
69 PACKAGE_TARNAME = ghc-${ProjectVersion}
70 $(eval $(call set_default,docdir,$${datarootdir}/doc/$${PACKAGE_TARNAME}))
71
72 htmldir = @htmldir@
73 dvidir = @dvidir@
74 pdfdir = @pdfdir@
75 psdir = @psdir@
76 $(eval $(call set_default,htmldir,$${docdir}))
77 $(eval $(call set_default,dvidir,$${docdir}))
78 $(eval $(call set_default,pdfdir,$${docdir}))
79 $(eval $(call set_default,psdir,$${docdir}))
80
81 ifeq "$(RelocatableBuild)" "YES"
82
83 # Hack: our directory layouts tend to be different on Windows, so
84 # hack around configure's bogus assumptions here.
85 datarootdir = $(prefix)
86 datadir = $(prefix)/lib
87 libdir = $(prefix)/lib
88
89 docdir = $(prefix)/doc
90 htmldir = $(docdir)
91 dvidir = $(docdir)
92 pdfdir = $(docdir)
93 psdir = $(docdir)
94
95 ghclibdir = $(libdir)
96
97 else
98
99 # Unix: override libdir and datadir to put ghc-specific stuff in
100 # a subdirectory with the version number included.
101 ghclibdir = $(libdir)/$(CrossCompilePrefix)ghc-$(ProjectVersion)
102 endif
103
104 ghclibexecdir = $(ghclibdir)
105 topdir = $(ghclibdir)
106 ghcheaderdir = $(ghclibdir)/include
107
108 #-----------------------------------------------------------------------------
109 # install configuration
110
111 #
112 # Set this to have files installed with a specific owner
113 #
114 INSTALL_OWNER =
115
116 #
117 # Set this to have files installed with a specific group
118 #
119 INSTALL_GROUP =
120
121 #
122 # Invocations of `install' for the four different classes
123 # of targets:
124 #
125 CREATE_SCRIPT = create () { touch "$$1" && chmod 755 "$$1" ; } && create
126 CREATE_DATA = create () { touch "$$1" && chmod 644 "$$1" ; } && create
127
128 INSTALL_PROGRAM = $(INSTALL) -m 755
129 INSTALL_SCRIPT = $(INSTALL) -m 755
130 INSTALL_SHLIB = $(INSTALL) -m 755
131 INSTALL_DATA = $(INSTALL) -m 644
132 INSTALL_HEADER = $(INSTALL) -m 644
133 INSTALL_MAN = $(INSTALL) -m 644
134 INSTALL_DOC = $(INSTALL) -m 644
135 INSTALL_DIR = $(INSTALL) -m 755 -d
136
137 # runhaskell and hsc2hs are special, in that other compilers besides
138 # GHC might provide them. Systems with a package manager often come
139 # with tools to manage this kind of clash, e.g. RPM's
140 # update-alternatives. When building a distribution for such a system,
141 # we recommend setting both of the following to 'YES'.
142 #
143 # NO_INSTALL_RUNHASKELL = YES
144 # NO_INSTALL_HSC2HS = YES
145 #
146 # NB. we use negative tests here because for binary-distributions we cannot
147 # test build-time variables at install-time, so they must default to on.
148
149 ifneq "$(DESTDIR)" ""
150 override DESTDIR := $(abspath $(DESTDIR))
151 endif
152