404f4d126b15d4cdb9b37053131f91b65d6b9411
[ghc-hetmet.git] / distrib / Makefile-bin.in
1 # Instructions for configuring an fptools package.
2 #
3 # There are two ways you can get started with an fptools package, either
4 # by using the unpacked distribution tree in-situ or by installing the
5 # package.
6 #
7 # Using the package directly is easy, just do `make config', i.e.,
8 # the distribution will *not* work out-of-the-box, you'll have to do
9 # this first.
10 #
11 # To install the package, you'll have to set one or more of the
12 # following variables:
13 #
14 #  * bindir 
15 #     path to directory of where you want the executables
16 #     to be installed.
17 #  * libdir
18 #     where you want the library archives to go.
19 #     Note, if you specify /usr/foo/lib for libdir,
20 #     the library files for your fptools package will be
21 #     installed in  /usr/foo/lib/<package>-<version>, i.e.,
22 #     /usr/foo/lib/ghc-2.02. If you don't want the package/version
23 #     directory appended, you'll have to modify $(real_libdir)
24 #     below.
25 #
26 #  * datadir
27 #     path to where the platform-independent files will go.
28 #     As for libdir, the effective path for the platform-indep
29 #     stuff is $(datadir)/<package>-<version>. If you want
30 #     complete control, see $(real_libdir)
31 #
32 #  * platform 
33 #     the platform you're installing for. The configure
34 #     makes an educated guess what it, so you will only
35 #     have to set this if it clashes with your reality.
36 #
37 #  * infodir
38 #     where to install the Emacs info files
39 #  * htmldir
40 #     where to install the documentation HTML files.
41 #  * dvidir
42 #     where to install the DVI files.
43 #
44 # Installing the documentation is not via the `install' rule, but
45 # via the rules: `install-docs', `install-html', `install-dvi'
46 # and `install-info'.
47 #
48 # For more complete instructions, consult the INSTALL file
49 # that came with the bundle, and/or consult the installation
50 # documentation in one of the document directories.
51 #
52 bindir    = @bindir@
53 libdir    = @libdir@
54 datadir   = @datadir@
55 platform  = @platform@
56
57 infodir   = @infodir@
58 htmldir   = @htmldir@
59 dvidir    = @dvidir@
60
61 #
62 # Putting the package stuff in package-specific
63 # directories:
64 #
65 real_libdir  = $(libdir)/$(package)-$(version)
66 real_datadir = $(datadir)/$(package)-$(version)
67
68
69
70
71 package   = ghc
72 version   = 2.02
73 PERL      = @PerlCmd@
74
75 .PHONY: config install install-dirs
76
77 config:
78         @echo Configuring $(package), version $(version), on $(platform)
79         @RM `pwd`/bin/$(platform)/$(package)-$(version)/$(package)-$(version)
80         @RM `pwd`/bin/$(platform)/$(package)-$(version)/$(package)
81         @echo $(PerlCmd)                  > `pwd`/bin/$(platform)/$(package)
82         @echo "$""bindir='"`pwd`"/bin/$(platform)/$(package)-$(version)';"    >> `pwd`/bin/$(platform)/$(package)-$(version)/$(package)
83         @echo "$""libdir='"`pwd`"/lib/$(platform)/$(package)-$(version)';"    >> `pwd`/bin/$(platform)/$(package)-$(version)/$(package)
84         @echo "$""datadir='"`pwd`"/share/$(platform)/$(package)-$(version)';" >> `pwd`/bin/$(platform)/$(package)-$(version)/$(package)
85         @cat `pwd`/bin/$(platform)/$(package)-$(version)/$(package).prl';"    >> `pwd`/bin/$(platform)/$(package)-$(version)/$(package)
86         @(cd `pwd`/bin/$(platform)/$(package)-$(version); $(LN_S) $(package) $(package)-$(version) )
87         @echo Finished..to use, add `pwd`/bin/$(platform)/$(package)-$(version) to your PATH.
88
89 libdirs  = . imports include
90 datadirs = . include
91
92 install-dirs:
93         $(MKDIRHIER) $(bindir) 
94         @for i in $(libdirs) ; do \
95           echo (MKDIRHIER) $(real_libdir)/$$i; \
96           (MKDIRHIER) $(real_libdir)/$$i; \
97         done;
98         @for i in $(datadirs) ; do \
99           echo (MKDIRHIER) $(real_datadir)/$$i; \
100           (MKDIRHIER) $(real_datadir)/$$i; \
101         done;
102
103 install : install-dirs
104
105 install :
106         $(INSTALL_PROGRAM) `pwd`/bin/$(platform)/$(package)-$(version)/* $(bindir)
107         @for i in $(libdirs); do \
108            echo $(INSTALL) `pwd`/lib/$(platform)/$(package)-$(version)/$$i/* $(real_libdir)/$$i; \
109            $(INSTALL) `pwd`/lib/$(platform)/$(package)-$(version)/$$i/* $(real_libdir)/$$i; \
110         done; 
111         @for i in $(datadirs); do \
112            echo $(INSTALL) `pwd`/share/$(package)-$(version)/$$i/* $(real_datadir)/$$i; \
113            $(INSTALL) `pwd`/share/$(package)-$(version)/$$i/* $(real_datadir)/$$i; \
114         done; 
115
116 install-docs : install-info install-html install-dvi
117
118 install-dirs-html:
119         $(MKDIRHIER) $(htmldir) 
120
121 install-dirs-info:
122         $(MKDIRHIER) $(infodir) 
123
124 install-dirs-dvi:
125         $(MKDIRHIER) $(dvidir) 
126
127 install-docs : install-html install-info install-dvi 
128
129 install-dvi: install-dirs-dvi
130         $(INSTALL) `pwd`/dvi/$(package)-$(version)/* $(dvidir)
131
132 install-info: install-dirs-info
133         $(INSTALL) `pwd`/info/$(package)-$(version)/* $(infodir)
134
135 install-html: install-dirs-html
136         $(INSTALL) `pwd`/html/$(package)-$(version)/* $(htmldir)
137