d8b91710931663bdb3580c8c0a3cf517c08ab665
[ghc-hetmet.git] / STARTUP.in
1 #! /bin/sh
2 #
3 # die quickly if anything goes astray...
4 set -e
5
6 # figure out the absolute pathname of the "top" directory
7 # (the one which has "mkworld", "nofib", "glafp-utils", etc., as subdirs)
8 hardtop=`pwd`
9 hardtop=`echo $hardtop | sed 's|^/tmp_mnt/|/|' | sed 's|^/export/|/|' | sed 's|^/grasp_tmp|/local/grasp_tmp|'`
10 echo ''
11 echo "*** The top of your build tree is: $hardtop"
12
13 case "$hardtop" in
14   # NeXTStep brain damage
15   /private/tmp_mnt/auto* )
16     echo '***'
17     echo '*** AAARRRGGGHHHH!!!'
18     echo '***'
19     echo '*** Stupid automounter (and pwd) will not tell me'
20     echo '*** the absolute pathname for the current directory.'
21     echo '*** Be sure to set TopDirPwd in mkworld/site-DEF.jm.'
22     echo '*** (Then it does not matter what this script decides.)'
23     echo '***'
24     ;;
25 esac
26
27 # make "mkworld", "literate", and "glafp-utils" (no special configuration)
28
29 #       make all the Makefiles first
30
31 for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
32   if [ -d $i ] ; then
33     ( set -e;                                                                   \
34       cd $i ;                                                                   \
35       echo '' ;                                                                 \
36       echo "*** configuring $i ..." ;                                           \
37       make -f Makefile.BOOT BOOT_DEFINES="-P none -S std -DTopDirPwd=$hardtop"; \
38       echo '' ;                                                                 \
39       echo "*** making Makefiles in $i ..." ;                                   \
40       make Makefile ;                                                           \
41       make Makefiles                                                            \
42     )
43   else
44     echo warning: $i is not a directory -- doing nothing for it
45   fi
46 done
47
48 #       now make the dependencies and Real Stuff
49
50 for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
51   if [ -d $i ] ; then
52     ( set -e;                                                                   \
53       cd $i ;                                                                   \
54       echo '' ;                                                                 \
55       echo "*** making dependencies in $i ..." ;                                \
56       make depend ;                                                             \
57       echo '' ;                                                                 \
58       echo "*** making all in $i ..." ;                                         \
59       make all                                                                  \
60     )
61   else
62     echo warning: $i is not a directory -- doing nothing for it
63   fi
64 done
65
66 # OK, now make the \`real' Makefiles
67
68 for i in @DoingGHC@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ ; do
69   if [ -d $i ] ; then
70     ( set -e;                                                                   \
71       cd $i ;                                                                   \
72       echo '' ;                                                                 \
73       echo "*** configuring $i ..." ;                                           \
74       make -f Makefile.BOOT BOOT_DEFINES="-P $i -S @MkWorldSetup@ -C mkworld -DTopDirPwd=$hardtop";     \
75       echo '' ;                                                                 \
76       echo "*** making Makefiles in $i ..." ;                                   \
77       make Makefile ;                                                           \
78       make Makefiles                                                            \
79     )
80   else
81     echo warning: $i is not a directory -- doing nothing for it
82   fi
83 done
84
85 # Finally, the dependencies
86
87 for i in @DoingGHC@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ ; do
88   if [ -d $i ] ; then
89     ( set -e;                                                                   \
90       cd $i ;                                                                   \
91       echo '' ;                                                                 \
92       echo "*** making dependencies in $i ..." ;                                \
93       make depend                                                               \
94     )
95   else
96     echo warning: $i is not a directory -- doing nothing for it
97   fi
98 done
99
100 echo ''
101 echo '*******************************************************************'
102 echo "* Looking good! All you should need to do now is...               *"
103 echo '*                                                                 *'
104 for i in @DoingGHC@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ ; do
105     echo "        cd $i"
106     if [ $i = nofib ] ; then
107         echo '        make all        # or...'
108         echo '        make runtests'
109     else
110         echo '        make all'
111         echo '        make install   # if you are so inclined...'
112     fi
113 done
114 echo '*                                                                 *'
115 echo '*******************************************************************'
116 exit 0