Annotation of Gnu-Mach/mig/mig.sh, revision 1.1

1.1     ! root        1: #!/bin/sh 
        !             2: #
        !             3: # Mach Operating System
        !             4: # Copyright (c) 1991,1990 Carnegie Mellon University
        !             5: # All Rights Reserved.
        !             6: # 
        !             7: # Permission to use, copy, modify and distribute this software and its
        !             8: # documentation is hereby granted, provided that both the copyright
        !             9: # notice and this permission notice appear in all copies of the
        !            10: # software, derivative works or modified versions, and any portions
        !            11: # thereof, and that both notices appear in supporting documentation.
        !            12: # 
        !            13: # CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
        !            14: # CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
        !            15: # ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
        !            16: # 
        !            17: # Carnegie Mellon requests users of this software to return to
        !            18: # 
        !            19: #  Software Distribution Coordinator  or  [email protected]
        !            20: #  School of Computer Science
        !            21: #  Carnegie Mellon University
        !            22: #  Pittsburgh PA 15213-3890
        !            23: # 
        !            24: # any improvements or extensions that they make and grant Carnegie Mellon
        !            25: # the rights to redistribute these changes.
        !            26: #
        !            27: 
        !            28: migcom=${MIGDIR-@MIGDIR@}/migcom
        !            29: cpp="${CPP-@CPP@}"
        !            30: 
        !            31: cppflags=
        !            32: migflags=
        !            33: files=
        !            34: 
        !            35: # If an argument to this shell script contains whitespace,
        !            36: # then we will screw up.  migcom will see it as multiple arguments.
        !            37: #
        !            38: # As a special hack, if -i is specified first we don't pass -user to migcom.
        !            39: # We do use the -user argument for the dependencies.
        !            40: # In this case, the -user argument can have whitespace.
        !            41: 
        !            42: until [ $# -eq 0 ]
        !            43: do
        !            44:     case "$1" in
        !            45:        -[qQvVtTrRsS] ) migflags="$migflags $1"; shift;;
        !            46:        -i      ) sawI=1; migflags="$migflags $1 $2"; shift; shift;;
        !            47:        -user   ) user="$2"; if [ ! "${sawI-}" ]; then migflags="$migflags $1 $2"; fi; shift; shift;;
        !            48:        -server ) server="$2"; migflags="$migflags $1 $2"; shift; shift;;
        !            49:        -header ) header="$2"; migflags="$migflags $1 $2"; shift; shift;;
        !            50:        -sheader ) sheader="$2"; migflags="$migflags $1 $2"; shift; shift;;
        !            51:        -iheader ) iheader="$2"; migflags="$migflags $1 $2"; shift; shift;;
        !            52:        -prefix | -subrprefix ) migflags="$migflags $1 $2"; shift; shift;;
        !            53: 
        !            54:        -MD ) sawMD=1; cppflags="$cppflags $1"; shift;;
        !            55:        -imacros ) cppflags="$cppflags $1 $2"; shift; shift;;
        !            56:        -cc) cpp="$2"; shift; shift;;
        !            57:        -migcom) migcom="$2"; shift; shift;;
        !            58:        -* ) cppflags="$cppflags $1"; shift;;
        !            59:        * ) files="$files $1"; shift;;
        !            60:     esac
        !            61: done
        !            62: 
        !            63: for file in $files
        !            64: do
        !            65:     $cpp $cppflags "$file" | $migcom $migflags || exit
        !            66: 
        !            67:     if [ $sawMD ]
        !            68:     then
        !            69:        base="`basename "$file"|sed 's%[.][^.]*$%%'`"
        !            70:        deps=
        !            71:        rheader="${header-${base}.h}"
        !            72:        if [ "$rheader" != /dev/null ]; then deps="$deps $rheader"; fi
        !            73:        ruser="${user-${base}User.c}"
        !            74:        if [ "$ruser" != /dev/null ]; then
        !            75:                if [ $sawI ]; then
        !            76:                    for un in $ruser 
        !            77:                    do
        !            78:                        deps="$deps $un"
        !            79:                    done
        !            80:                else
        !            81:                    deps="$deps $ruser"
        !            82:                fi
        !            83:        fi
        !            84:        rserver="${server-${base}Server.c}"
        !            85:        if [ "$rserver" != /dev/null ]; then deps="$deps $rserver"; fi
        !            86:        rsheader="${sheader-/dev/null}"
        !            87:        if [ "$rsheader" != /dev/null ]; then deps="$deps $rsheader"; fi
        !            88:        riheader="${iheader-/dev/null}"
        !            89:        if [ "$riheader" != /dev/null ]; then deps="$deps $riheader"; fi
        !            90:        sed 's%^[^:]*:%'"${deps}"':%' <"${base}.d" >"${base}-mig.d"
        !            91:        rm -f ${base}.d
        !            92:     fi
        !            93: done
        !            94: 
        !            95: exit 0

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.