Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/config/_ml-makedepend
ViewVC logotype

Diff of /sml/trunk/config/_ml-makedepend

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 691, Tue Jul 25 07:20:24 2000 UTC revision 692, Thu Jul 27 08:34:53 2000 UTC
# Line 8  Line 8 
8  tmpmf=$xx-makefile  tmpmf=$xx-makefile
9  mlscript=$xx-mlscript.sml  mlscript=$xx-mlscript.sml
10  thisscript=$0  thisscript=$0
11    archos=substitute
12    archstring='$(ARCH)'
13    osstring='$(OS)'
14    dulist=''
15    
16  trap 'rm -f $tmpmf $mlscript' 0 1 2 3 15  trap 'rm -f $tmpmf $mlscript' 0 1 2 3 15
17    
18  usage() {  usage() {
19      echo $thisscript: $*      echo $thisscript: $*
20      echo Usage: $thisscript '[-f makefile]' cmfile targetname      echo Usage: $thisscript '[-f makefile] [-n] [-a arch] [-o os]' project.cm target
21      exit 1      exit 1
22  }  }
23    
24  #  #
25  # process -f option if it is given  # process options
26  #  #
27  if [ $# != 0 ] ; then  while [ $# != 0 ] ; do
28      if [ "$1" = "-f" ] ; then      case $1 in
29        -n)
30            shift
31            archos=real
32            ;;
33        -a)
34            shift
35            if [ $# = 0 ] ; then
36                usage
37            else
38                archstring=$1
39                shift
40            fi
41            ;;
42        -o)
43            shift
44            if [ $# = 0 ] ; then
45                usage
46            else
47                osstring=$1
48                shift
49            fi
50            ;;
51        -f)
52          shift          shift
53          if [ $# = 0 ] ; then          if [ $# = 0 ] ; then
54              usage              usage
55          else          else
56              mf=$1              mf=$1
57              shift              shift
58            fi
59              if [ -f "$mf" ] ; then              if [ -f "$mf" ] ; then
60                  : ok                  : ok
61              else              else
62                  echo $thisscript: $mf does not exist                  echo $thisscript: $mf does not exist
63                  exit 1                  exit 1
64              fi              fi
65          fi          ;;
66      fi      -D*|-U*)
67  fi          dulist="$dulist $1"
68            shift
69            ;;
70        *)
71            break
72            ;;
73        esac
74    done
75    
76  #  #
77  # if there was no -f option, check for makefile and then Makefile  # if there was no -f option, check for makefile and then Makefile
# Line 62  Line 97 
97      usage      usage
98  fi  fi
99    
100    if [ $archos = substitute ] ; then
101        archosarg="(SOME { arch = \"${archstring}\", os = \"${osstring}\" })"
102    else
103        archosarg=NONE
104    fi
105    
106  #  #
107  # the delimiter strings (start and end)  # the delimiter strings (start and end)
108  #  #
# Line 83  Line 124 
124  # construct the ML script  # construct the ML script
125  #  #
126  cat >$mlscript <<stop  cat >$mlscript <<stop
127  let val archos = SOME { arch = "\$(ARCH)", os = "\$(OPSYS)" }  let val archos = ${archosarg}
128      val lopt = CM.sources archos "${cmfile}"      val lopt = CM.sources archos "${cmfile}"
129  in  in
130      case lopt of      case lopt of
# Line 102  Line 143 
143  end  end
144  stop  stop
145    
146  if $SML '$smlnj/cm.cm' $mlscript >/dev/null 2>&1 ; then  if $SML '$smlnj/cm.cm' $dulist $mlscript ; then
147      cat $tmpmf >>$mf      cat $tmpmf >>$mf
148  else  else
149      echo $thisscript: CM dependency analysis failed      echo $thisscript: CM dependency analysis failed

Legend:
Removed from v.691  
changed lines
  Added in v.692

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0