STARTUP.in 3.73 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#! /bin/sh
#
# die quickly if anything goes astray...
set -e

# figure out the absolute pathname of the "top" directory
# (the one which has "mkworld", "nofib", "glafp-utils", etc., as subdirs)
hardtop=`pwd`
hardtop=`echo $hardtop | sed 's|^/tmp_mnt/|/|' | sed 's|^/export/|/|' | sed 's|^/grasp_tmp|/local/grasp_tmp|'`
echo ''
echo "*** The top of your build tree is: $hardtop"

case "$hardtop" in
  # NeXTStep brain damage
  /private/tmp_mnt/auto* )
    echo '***'
    echo '*** AAARRRGGGHHHH!!!'
    echo '***'
    echo '*** Stupid automounter (and pwd) will not tell me'
    echo '*** the absolute pathname for the current directory.'
    echo '*** Be sure to set TopDirPwd in mkworld/site-DEF.jm.'
    echo '*** (Then it does not matter what this script decides.)'
    echo '***'
    ;;
esac

# make "mkworld", "literate", and "glafp-utils" (no special configuration)

#	make all the Makefiles first

for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
  if [ -d $i ] ; then
33 34 35 36 37 38 39 40 41
    ( set -e;								\
      cd $i ;								\
      echo '' ;								\
      echo "*** configuring $i ..." ;					\
      @MakeCmd@ -f Makefile.BOOT BOOT_DEFINES="-P none -S std -DTopDirPwd=$hardtop";	\
      echo '' ;								\
      echo "*** making Makefiles in $i ..." ;				\
      @MakeCmd@ Makefile ; 						\
      @MakeCmd@ Makefiles 						\
42 43 44 45 46 47 48 49 50 51
    )
  else
    echo warning: $i is not a directory -- doing nothing for it
  fi
done

#	now make the dependencies and Real Stuff

for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
  if [ -d $i ] ; then
52 53 54 55 56 57 58 59
    ( set -e;								\
      cd $i ;								\
      echo '' ;								\
      echo "*** making dependencies in $i ..." ;			\
      @MakeCmd@ depend ;						\
      echo '' ;								\
      echo "*** making all in $i ..." ;					\
      @MakeCmd@ all							\
60 61 62 63 64 65 66 67
    )
  else
    echo warning: $i is not a directory -- doing nothing for it
  fi
done

# OK, now make the \`real' Makefiles

68 69
passed_in_setup="-S @MkWorldSetup@"

70
for i in @DoingGHC@ @DoingHsLibs@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
71 72 73 74 75
  if [ $i = nofib ] ; then
     setup=$passed_in_setup
  else
     setup=''
  fi
76
  if [ -d $i ] ; then
77 78 79 80 81 82 83 84 85
    ( set -e;								\
      cd $i ;								\
      echo '' ;								\
      echo "*** configuring $i ..." ;					\
      @MakeCmd@ -f Makefile.BOOT BOOT_DEFINES="-P $i $setup -C mkworld -DTopDirPwd=$hardtop"; \
      echo '' ;								\
      echo "*** making Makefiles in $i ..." ;				\
      @MakeCmd@ Makefile ; 						\
      @MakeCmd@ Makefiles 						\
86 87
    )
  else
88 89 90
    if [ $i != EndOfList ] ; then
	echo warning: $i is not a directory -- doing nothing for it
    fi
91 92 93 94 95
  fi
done

# Finally, the dependencies

96
for i in @DoingGHC@ @DoingHsLibs@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
97
  if [ -d $i ] ; then
98 99 100 101 102
    ( set -e;								\
      cd $i ;								\
      echo '' ;								\
      echo "*** making dependencies in $i ..." ;			\
      @MakeCmd@ depend 							\
103 104
    )
  else
105 106 107
    if [ $i != EndOfList ] ; then
	echo warning: $i is not a directory -- doing nothing for it
    fi
108 109 110 111 112 113 114
  fi
done

echo ''
echo '*******************************************************************'
echo "* Looking good! All you should need to do now is...               *"
echo '*                                                                 *'
115
for i in @DoingGHC@ @DoingHsLibs@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
116 117 118 119 120 121 122 123 124
    if [ $i != EndOfList ] ; then
	echo "        cd $i"
	if [ $i = nofib ] ; then
	    echo '        make all        # or...'
	    echo '        make runtests'
	else
	    echo '        make all'
	    echo '        make install   # if you are so inclined...'
	fi
125 126 127 128 129
    fi
done
echo '*                                                                 *'
echo '*******************************************************************'
exit 0