allow build settings to be overriden by adding mk/validate.mk
[ghc-hetmet.git] / distrib / Makefile
1
2 include Makefile-vars
3
4 .PHONY: in-place mk-version-symlinks install-dirs install
5
6 in-place ::
7         @if test -x "./post-inplace-script" ; then \
8                 echo "Running project-specific post-inplace script ..." ; \
9                 ./post-inplace-script $(platform) `pwd` \
10                         $(package)-$(version); \
11                 echo "Done" ; \
12         fi
13         @echo "Finished configuring..to use, add `pwd`/bin/$(platform) to your PATH."
14
15 install ::
16         $(INSTALL_DIR) $(bindir)
17         (cd lib/$(platform); find . -type d -exec sh -c '$(INSTALL_DIR) $$0 $(libdir)/$$0' {} \; )
18         (cd share; find . -type d -exec sh -c '$(INSTALL_DIR) $(datadir)/$$0' {} \; )
19
20 install::
21         $(MAKE) -C includes  install DOING_BIN_DIST=YES
22         $(MAKE) -C driver    install DOING_BIN_DIST=YES
23         $(MAKE) -C utils     install DOING_BIN_DIST=YES
24         $(MAKE) -C rts       install DOING_BIN_DIST=YES
25         $(MAKE) -C libraries install DOING_BIN_DIST=YES
26         $(MAKE) -C compiler  install DOING_BIN_DIST=YES
27
28 install :: install-docs postinstall denounce
29
30 .PHONY: postinstall denounce
31
32 denounce:
33         @echo
34         @echo =======================================================================
35         @echo Installation of $(package)-$(version) was successful.
36         @echo
37         @echo To use, add $(bindir) to your PATH.
38         @echo
39         @if test -f share/html/index.html; then \
40            echo For documentation, see $(htmldir)/index.html ; \
41         elif test -d share/html ; then \
42            echo Docs can be found in $(htmldir). ; \
43         else \
44            echo "Warning: this binary distribution does NOT contain documentation!" ; \
45         fi
46         @echo =======================================================================
47
48 postinstall:
49         @if test -x "./post-install-script" ; then \
50                 echo "Running project-specific post-install script ..." ; \
51                 ./post-install-script $(platform) $(libdir) ; \
52                 echo "Done" ; \
53         fi
54
55 show-install-setup:
56         @echo "Install setup..."
57         @echo "bindir  = $(bindir)"
58         @echo "libdir  = $(libdir) (libdir  = $(libdir))"
59         @echo "datadir = $(datadir) (datadir = $(datadir))"
60
61 #
62 # Documentation targets: install-docs.
63 #
64
65 .PHONY: show-install-setup install-docs install-dirs-docs
66
67 install-docs : install-dirs-docs
68         if test -d share/html ; then $(CP) -r share/html/* $(htmldir) ; fi
69         set -e; for i in share/*.ps; do \
70                 if test -f "$$i"; then \
71                       $(CP) $$i $(psdir) ; \
72                 fi \
73         done
74
75 install-dirs-docs:
76         $(INSTALL_DIR) $(htmldir) 
77