3 PACKAGE_SH_SCRIPTS = ghc-6.5.20060205 ghci-6.5.20060205 ghc-pkg-6.5.20060205 hsc2hs
4 PACKAGE_PRL_SCRIPTS = ghcprof
5 PACKAGE_LIB_PRL_SCRIPTS = ghc-asm ghc-split
6 PACKAGE_LIB_SPLICED_FILES = package.conf
7 PACKAGE_BINS = hp2ps runghc
8 PACKAGE_OPT_BINS = runhaskell
9 PACKAGE_LINKS = ghc ghci ghc-pkg
13 # Instructions for configuring an fptools package.
15 # There are two ways you can get started with an fptools package, either
16 # by using the unpacked distribution tree in-situ or by installing the
19 # Using the package directly is easy, just do `make in-place'. (The
20 # distribution will *not* work straight out of the box, you'll have to do
23 # To install the package, you'll have to set one or more of the
24 # following variables:
27 # path to directory of where you want the executables
30 # where you want the library archives to go.
31 # Note, if you specify /usr/foo/lib for libdir,
32 # the library files for your fptools package will be
33 # installed in /usr/foo/lib/<package>-<version>, e.g.,
34 # /usr/foo/lib/ghc-3.00. If you don't want the package/version
35 # directory appended, you'll have to modify $(real_libdir)
39 # path to where the platform-independent files will go.
40 # As for libdir, the effective path for the platform-indep
41 # stuff is $(datadir)/<package>-<version>. If you want
42 # complete control, see $(real_datadir)
45 # the platform you're installing for. The configure script
46 # makes an educated guess, so you'll only have to set this
47 # if it clashes with your reality, I guess.
50 # where to install the HTML documentation files.
52 # where to install the PDF documentation files.
54 # where to install the Postscript documentation files.
56 # For more complete instructions, consult the INSTALL file
57 # that came with the bundle, and/or consult the installation
58 # documentation in one of the document directories.
60 # Please report any bugs, problems etc. with installing and using this bundle
61 # Makefile setup to glasgow-haskell-bugs@dcs.gla.ac.uk
64 # Where the different pieces of the bundle should go:
66 libdir = @libdir@/$(package)-$(version)
67 datadir = @datadir@/$(package)-$(version)
69 platform = @TargetPlatform@
71 exec_prefix = @exec_prefix@
74 htmldir = $(datadir)/html
92 INSTALL_DIR = ./mkdirhier
95 # Set of package scripts for which you'd like a name-<version> symlink
96 # to be created, i.e., create a symlink, ghc-$(version), pointing to ghc to
97 # avoid version vertigo.
99 VERSION_SYMLINKS_FOR=$(PACKAGE_LINKS)
101 # Binaries to install
102 PACKAGE_BIN_INSTALL=$(PACKAGE_PRL_SCRIPTS) $(PACKAGE_SH_SCRIPTS)
104 #----------end of user-serviceable parts------------
107 # How to install the different pieces
109 INSTALL_BIN = $(INSTALL) $(INSTALL_BIN_OPTS)
110 INSTALL_LIB = $(INSTALL) $(INSTALL_LIB_OPTS)
111 INSTALL_DATA = $(INSTALL) $(INSTALL_DATA_OPTS)
113 # What's common to all installs
114 INSTALL_OPTS= $(EXTRA_INSTALL_OPTS)
119 INSTALL_BIN_OPTS = -m $(BIN_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_BIN_OPTS)
120 INSTALL_LIB_OPTS = -m $(LIB_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_LIB_OPTS)
121 INSTALL_DATA_OPTS = -m $(LIB_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_DATA_OPTS)
123 .PHONY: in-place config-pkgs mk-version-symlinks install-dirs install
126 @echo "Configuring $(package), version $(version), on $(platform) ..."
127 @for i in $(PACKAGE_PRL_SCRIPTS) ""; do \
128 if test "$$i"; then \
129 echo "Creating a configured version of $$i .."; \
130 $(RM) bin/$(platform)/$$i.bak; \
131 if [ -f bin/$(platform)/$$i ]; then $(MV) bin/$(platform)/$$i bin/$(platform)/$$i.bak; fi; \
132 echo "#! $(PERL)" > bin/$(platform)/$$i ; \
133 echo '$$'"bindir='$(bindir)';" >> bin/$(platform)/$$i ; \
134 echo '$$'"libdir='$(libdir)';" >> bin/$(platform)/$$i ; \
135 echo '$$'"libexecdir='$(libdir)';" >> bin/$(platform)/$$i ; \
136 echo '$$'"datadir='$(datadir)';" >> bin/$(platform)/$$i ; \
137 echo '$$'"SED='$(SED)';" >> bin/$(platform)/$$i ; \
138 echo '$$'"DEFAULT_TMPDIR='$(DEFAULT_TMPDIR)';" >> bin/$(platform)/$$i ; \
139 cat bin/$(platform)/$$i.prl >> bin/$(platform)/$$i ; \
140 $(CHMOD) $(BIN_PERMS) bin/$(platform)/$$i; \
144 @for i in $(PACKAGE_LIB_PRL_SCRIPTS) ""; do \
145 if test "$$i"; then \
146 echo "Creating a configured version of $$i .."; \
147 $(RM) lib/$(platform)/$$i.bak; \
148 if [ -f lib/$(platform)/$$i ]; then $(MV) lib/$(platform)/$$i lib/$(platform)/$$i.bak; fi; \
149 echo "#! $(PERL)" > lib/$(platform)/$$i ; \
150 echo '$$'"bindir='$(bindir)';" >> lib/$(platform)/$$i ; \
151 echo '$$'"libdir='$(libdir)';" >> lib/$(platform)/$$i ; \
152 echo '$$'"libexecdir='$(libdir)';" >> lib/$(platform)/$$i ; \
153 echo '$$'"datadir='$(datadir)';" >> lib/$(platform)/$$i ; \
154 echo '$$'"SED='$(SED)';" >> lib/$(platform)/$$i ; \
155 echo '$$'"DEFAULT_TMPDIR='$(DEFAULT_TMPDIR)';" >> lib/$(platform)/$$i ; \
156 cat lib/$(platform)/$$i.prl >> lib/$(platform)/$$i; \
157 $(CHMOD) $(BIN_PERMS) lib/$(platform)/$$i; \
161 @for i in $(PACKAGE_SH_SCRIPTS) ""; do \
162 if test "$$i"; then \
163 echo "Creating a configured version of $$i .."; \
164 $(RM) bin/$(platform)/$$i.bak; \
165 if [ -f bin/$(platform)/$$i ]; then $(MV) bin/$(platform)/$$i bin/$(platform)/$$i.bak; fi; \
166 echo "#! $(SH)" > bin/$(platform)/$$i ; \
167 echo "bindir='$(bindir)'" >> bin/$(platform)/$$i ; \
168 echo "libdir='$(libdir)'" >> bin/$(platform)/$$i ; \
169 echo "libexecdir='$(libdir)'" >> bin/$(platform)/$$i ; \
170 echo "datadir='$(datadir)'" >> bin/$(platform)/$$i ; \
171 echo "SED='$(SED)'" >> bin/$(platform)/$$i ; \
172 echo "DEFAULT_TMPDIR='$(DEFAULT_TMPDIR)'" >> bin/$(platform)/$$i ; \
173 cat bin/$(platform)/$$i.sh >> bin/$(platform)/$$i; \
174 $(CHMOD) $(BIN_PERMS) bin/$(platform)/$$i; \
178 @for i in $(PACKAGE_LIB_SPLICED_FILES) ""; do \
179 if test "$$i"; then \
180 echo "Creating a configured version of $$i .."; \
181 $(PERL) -i.bak -lpe 's|\$$libdir|$(libdir)|g;s|\$$datadir|$(datadir)|g' lib/$(platform)/$$i; \
184 @if test "$(platform)" = "powerpc-apple-darwin"; then \
185 echo "Configuring install names..."; \
186 for i in lib/$(platform)/*; do \
187 sh fix_install_names.sh "$(libdir)" "$$i"; \
193 $(MAKE) $(MFLAGS) config-pkgs bindir=`pwd`/bin/$(platform) libdir=`pwd`/lib/$(platform) datadir=`pwd`/share
194 @if test -x "./post-inplace-script" ; then \
195 echo "Running project-specific post-inplace script ..." ; \
196 ./post-inplace-script $(platform) `pwd` \
197 $(package)-$(version); \
200 @echo "Finished configuring..to use, add `pwd`/bin/$(platform) to your PATH."
203 $(INSTALL_DIR) $(bindir)
204 (cd lib/$(platform); find . -type d -exec sh -c '../../$(INSTALL_DIR) $$0 $(libdir)/$$0' {} \; )
205 (cd share; find . -type d -exec sh -c '../$(INSTALL_DIR) $(datadir)/$$0' {} \; )
207 install :: config-pkgs install-dirs install-bin install-libs install-datas install-docs postinstall denounce
209 .PHONY: install-bin install-libs install-datas postinstall denounce
213 @echo =======================================================================
214 @echo Installation of $(package)-$(version) was successful.
216 @echo To use, add $(bindir) to your PATH.
218 @if test -f share/html/index.html; then \
219 echo For documentation, see $(htmldir)/index.html ; \
220 elif test -d share/html ; then \
221 echo Docs can be found in $(htmldir). ; \
223 echo "Warning: this binary distribution does NOT contain documentation!" ; \
225 @echo =======================================================================
228 @if test -x "./post-install-script" ; then \
229 echo "Running project-specific post-install script ..." ; \
230 ./post-install-script $(platform) $(libdir) ; \
235 for i in $(PACKAGE_BIN_INSTALL) ""; do \
236 if test -n "$$i" ; then $(INSTALL_BIN) bin/$(platform)/$$i $(bindir); fi; \
238 for i in $(PACKAGE_BINS) ""; do \
239 if test -n "$$i" ; then $(INSTALL_BIN) bin/$(platform)/$$i$(exeext) $(bindir); fi; \
241 for i in $(PACKAGE_OPT_BINS) ""; do \
242 if test -n "$$i" -a ! -f "$(bindir)/$$i" ; then $(INSTALL_BIN) bin/$(platform)/$$i$(exeext) $(bindir); fi; \
244 @for i in $(VERSION_SYMLINKS_FOR) ""; do \
245 if [ "x$$i" != "x" ]; then \
247 if ( $(PERL) -e '$$fn="'$$i'"; exit ((! -f $$fn || -l $$fn) ? 0 : 1);' ); then \
248 echo "Creating a symbolic link from $$i-$(version) to $$i"; \
250 $(LN_S) $$i-$(version) $$i; \
252 echo "Creating a symbolic link from $$i-$(version) to $$i failed: \`$$i' already exists"; \
253 echo "Perhaps remove \`$$i' manually?"; \
262 (cd lib/$(platform); find . -type f -exec sh -c '$(CP) $$0 $(libdir)/$$0' {} \; )
265 for i in `(cd share; find . -type f )`; do \
266 $(INSTALL_DATA) share/$$i $(datadir)/$$i; \
270 @echo "Install setup..."
271 @echo "bindir = $(bindir)"
272 @echo "libdir = $(libdir) (libdir = $(libdir))"
273 @echo "datadir = $(datadir) (datadir = $(datadir))"
276 # Documentation targets: install-docs.
279 .PHONY: show-install-setup install-docs install-dirs-docs
281 install-docs : install-dirs-docs
282 if test -d share/html ; then $(CP) -r share/html/* $(htmldir) ; fi
283 for i in share/*.ps; do \
284 if test -f "$$i"; then \
285 $(CP) $$i $(psdir) ; \
290 $(INSTALL_DIR) $(htmldir)