4 # Instructions for configuring an fptools package.
6 # There are two ways you can get started with an fptools package, either
7 # by using the unpacked distribution tree in-situ or by installing the
10 # Using the package directly is easy, just do `make in-place'. (The
11 # distribution will *not* work straight out of the box, you'll have to do
14 # To install the package, you'll have to set one or more of the
15 # following variables:
18 # path to directory of where you want the executables
21 # where you want the library archives to go.
22 # Note, if you specify /usr/foo/lib for libdir,
23 # the library files for your fptools package will be
24 # installed in /usr/foo/lib/<package>-<version>, e.g.,
25 # /usr/foo/lib/ghc-3.00. If you don't want the package/version
26 # directory appended, you'll have to modify $(real_libdir)
30 # path to where the platform-independent files will go.
31 # As for libdir, the effective path for the platform-indep
32 # stuff is $(datadir)/<package>-<version>. If you want
33 # complete control, see $(real_datadir)
36 # the platform you're installing for. The configure script
37 # makes an educated guess, so you'll only have to set this
38 # if it clashes with your reality, I guess.
41 # where to install the documentation HTML files.
43 # where to install the DVI files.
45 # where to install the Emacs info files
47 # Installing the documentation is not done as part of the `install' rule, but
48 # via `install-docs' (or if you want to be selective: `install-html', `install-dvi'
49 # and `install-info').
51 # For more complete instructions, consult the INSTALL file
52 # that came with the bundle, and/or consult the installation
53 # documentation in one of the document directories.
55 # Please report any bugs, problems etc. with installing and using this bundle
56 # Makefile setup to glasgow-haskell-bugs@dcs.gla.ac.uk
59 # Where the different pieces of the bundle should go:
64 platform = @TargetPlatform@
66 exec_prefix = @exec_prefix@
74 # Putting the package stuff in package-specific
77 real_libdir = $(libdir)/$(package)-$(version)
78 real_datadir = $(datadir)/$(package)-$(version)
94 INSTALL_DIR = ./mkdirhier
97 # Set of package scripts for which you'd like a name-<version> symlink
98 # to be created, i.e., create a symlink, ghc-$(version), pointing to ghc to
99 # avoid version vertigo.
101 VERSION_SYMLINKS_FOR=$(package)
103 # Binaries to install
104 PACKAGE_BIN_INSTALL=$(PACKAGE_PRL_SCRIPTS) $(PACKAGE_SH_SCRIPTS) $(PACKAGE_BINS)
106 #----------end of user-serviceable parts------------
109 # How to install the different pieces
111 INSTALL_BIN = $(INSTALL) $(INSTALL_BIN_OPTS)
112 INSTALL_LIB = $(INSTALL) $(INSTALL_LIB_OPTS)
113 INSTALL_DATA = $(INSTALL) $(INSTALL_DATA_OPTS)
115 # What's common to all installs
116 INSTALL_OPTS= $(EXTRA_INSTALL_OPTS)
121 INSTALL_BIN_OPTS = -m $(BIN_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_BIN_OPTS)
122 INSTALL_LIB_OPTS = -m $(LIB_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_LIB_OPTS)
123 INSTALL_DATA_OPTS = -m $(LIB_PERMS) $(INSTALL_OPTS) $(EXTRA_INSTALL_DATA_OPTS)
125 .PHONY: in-place config-pkgs mk-version-symlinks install-dirs install
128 @echo "Configuring $(package), version $(version), on $(platform) ..."
129 @for i in $(PACKAGE_PRL_SCRIPTS) ""; do \
130 if test "$$i"; then \
131 echo "Creating a configured version of $$i .."; \
132 $(RM) bin/$(platform)/$(package)-$(version)/$$i.bak; \
133 if [ -f bin/$(platform)/$(package)-$(version)/$$i ]; then $(MV) bin/$(platform)/$(package)-$(version)/$$i bin/$(platform)/$(package)-$(version)/$$i.bak; fi; \
134 echo "#! $(PERL)" > bin/$(platform)/$(package)-$(version)/$$i ; \
135 echo '$$'"bindir='$(bindir)';" >> bin/$(platform)/$(package)-$(version)/$$i ; \
136 echo '$$'"libdir='$(real_libdir)';" >> bin/$(platform)/$(package)-$(version)/$$i ; \
137 echo '$$'"libexecdir='$(real_libdir)';" >> bin/$(platform)/$(package)-$(version)/$$i ; \
138 echo '$$'"datadir='$(real_datadir)';" >> bin/$(platform)/$(package)-$(version)/$$i ; \
139 echo '$$'"SED='$(SED)';" >> bin/$(platform)/$(package)-$(version)/$$i ; \
140 echo '$$'"RAWCPP='$(RAWCPP)';" >> bin/$(platform)/$(package)-$(version)/$$i ; \
141 echo '$$'"TMPDIR='$(TMPDIR)';" >> bin/$(platform)/$(package)-$(version)/$$i ; \
142 cat bin/$(platform)/$(package)-$(version)/$$i.prl >> bin/$(platform)/$(package)-$(version)/$$i ; \
143 $(CHMOD) $(BIN_PERMS) bin/$(platform)/$(package)-$(version)/$$i; \
147 @for i in $(PACKAGE_LIB_PRL_SCRIPTS) ""; do \
148 if test "$$i"; then \
149 echo "Creating a configured version of $$i .."; \
150 $(RM) lib/$(platform)/$(package)-$(version)/$$i.bak; \
151 if [ -f lib/$(platform)/$(package)-$(version)/$$i ]; then $(MV) lib/$(platform)/$(package)-$(version)/$$i lib/$(platform)/$(package)-$(version)/$$i.bak; fi; \
152 echo "#! $(PERL)" > lib/$(platform)/$(package)-$(version)/$$i ; \
153 echo '$$'"bindir='$(bindir)';" >> lib/$(platform)/$(package)-$(version)/$$i ; \
154 echo '$$'"libdir='$(real_libdir)';" >> lib/$(platform)/$(package)-$(version)/$$i ; \
155 echo '$$'"libexecdir='$(real_libdir)';" >> lib/$(platform)/$(package)-$(version)/$$i ; \
156 echo '$$'"datadir='$(real_datadir)';" >> lib/$(platform)/$(package)-$(version)/$$i ; \
157 echo '$$'"SED='$(SED)';" >> lib/$(platform)/$(package)-$(version)/$$i ; \
158 echo '$$'"RAWCPP='$(RAWCPP)';" >> lib/$(platform)/$(package)-$(version)/$$i ; \
159 echo '$$'"TMPDIR='$(TMPDIR)';" >> lib/$(platform)/$(package)-$(version)/$$i ; \
160 cat lib/$(platform)/$(package)-$(version)/$$i.prl >> lib/$(platform)/$(package)-$(version)/$$i; \
161 $(CHMOD) $(BIN_PERMS) lib/$(platform)/$(package)-$(version)/$$i; \
165 @for i in $(PACKAGE_SH_SCRIPTS) ""; do \
166 if test "$$i"; then \
167 echo "Creating a configured version of $$i .."; \
168 $(RM) bin/$(platform)/$(package)-$(version)/$$i.bak; \
169 if [ -f bin/$(platform)/$(package)-$(version)/$$i ]; then $(MV) bin/$(platform)/$(package)-$(version)/$$i bin/$(platform)/$(package)-$(version)/$$i.bak; fi; \
170 echo "#! $(SH)" > bin/$(platform)/$(package)-$(version)/$$i ; \
171 echo "bindir='$(bindir)'" >> bin/$(platform)/$(package)-$(version)/$$i ; \
172 echo "libdir='$(real_libdir)'" >> bin/$(platform)/$(package)-$(version)/$$i ; \
173 echo "libexecdir='$(real_libdir)'" >> bin/$(platform)/$(package)-$(version)/$$i ; \
174 echo "datadir='$(real_datadir)'" >> bin/$(platform)/$(package)-$(version)/$$i ; \
175 echo "SED='$(SED)'" >> bin/$(platform)/$(package)-$(version)/$$i ; \
176 echo "RAWCPP='$(RAWCPP)'" >> bin/$(platform)/$(package)-$(version)/$$i ; \
177 echo "TMPDIR='$(TMPDIR)'" >> bin/$(platform)/$(package)-$(version)/$$i ; \
178 cat bin/$(platform)/$(package)-$(version)/$$i.sh >> bin/$(platform)/$(package)-$(version)/$$i; \
179 $(CHMOD) $(BIN_PERMS) bin/$(platform)/$(package)-$(version)/$$i; \
184 # Convert pwd's UNC reported path into DOS style
186 CURRENT_DIR = $(shell pwd | sed 's|^//\(.\)|\1:|' )
189 $(MAKE) $(MFLAGS) config-pkgs bindir=$(CURRENT_DIR)/bin/$(platform)/$(package)-$(version) libdir=$(CURRENT_DIR)/lib/$(platform) datadir=$(CURRENT_DIR)/share/$(package)-$(version)
190 @echo "Finished configuring..to use, add $(CURRENT_DIR)/bin/$(platform)/$(package)-$(version) to your PATH."
193 $(INSTALL_DIR) $(bindir)
194 (cd lib/$(platform)/$(package)-$(version); find . -type d -exec sh -c '../../../$(INSTALL_DIR) $$0 $(real_libdir)/$$0' {} \; )
195 (cd share/$(package)-$(version); find . -type d -exec sh -c '../../$(INSTALL_DIR) $(real_datadir)/$$0' {} \; )
197 install :: config-pkgs install-dirs install-bin install-libs install-datas
199 .PHONY: install-bin install-libs install-datas
202 for i in $(PACKAGE_BIN_INSTALL); do \
203 $(INSTALL_BIN) bin/$(platform)/$(package)-$(version)/$$i $(bindir); \
205 for i in $(VERSION_SYMLINKS_FOR) ""; do \
206 if [ "x$$i" != "x" ]; then \
209 $(LN_S) $$i-$(version) $$i \
216 (cd lib/$(platform)/$(package)-$(version); find . -type f -exec sh -c '$(CP) $$0 $(real_libdir)/$$0' {} \; )
219 (cd share/$(package)-$(version); find . -type f -exec sh -c '$(INSTALL_DATA) $$0 $(real_datadir)/$$0' {} \; )
222 @echo "Install setup..."
223 @echo "bindir = $(bindir)"
224 @echo "libdir = $(libdir) (real_libdir = $(real_libdir))"
225 @echo "datadir = $(datadir) (real_datadir = $(real_datadir))"
228 # Documentation targets, install-docs for the whole lot, or
229 # install-{dvi,html,info}
232 .PHONY: show-install-setup install-docs install-html install-info install-dirs-dvi install-dirs-html install-dirs-info
234 install-docs : install-html install-dvi install-info
236 install-dvi: install-dirs-dvi
237 $(INSTALL_DATA) dvi/$(package)-$(version)/* $(dvidir)
239 install-info: install-dirs-info
240 $(INSTALL_DATA) info/$(package)-$(version)/* $(infodir)
242 install-html: install-dirs-html
243 $(INSTALL_DATA) html/$(package)-$(version)/* $(htmldir)
246 $(INSTALL_DIR) $(htmldir)
249 $(INSTALL_DIR) $(infodir)
252 $(INSTALL_DIR) $(dvidir)