PennMUSH Community

root/1.8.3/trunk/utils/clwrapper.sh

Revision 846, 1.0 kB (checked in by penndev, 1 year ago)

PennMUSH 1.8.3p2 release candidate.

  • Property svn:executable set to *
Line 
1 #!/bin/sh
2 # A wrapper we use in the win32 build
3 #
4
5 outfile=""
6 while test $# -gt 0; do
7     case "x$1" in
8     x) shift; args="$args ''";;
9     x-) shift; cat >_$$.c; args="$args _$$.c"; nukefiles=_$$.c;;
10     x-o)
11         shift
12         case "x$1" in
13         x*.o) args="$args /Fo$1";;
14         xnetmud) outfile="/out:PennMUSH.exe";;
15         x*) outfile="/out:$1.exe";;
16         esac
17         shift
18         ;;
19     x-c) shift; args="$args /c";;
20     x-E) shift; args="$args /E";;
21     x-D*) args="$args `echo $1 | sed 's/^-/\//'`"; shift;;
22     x-I*) args="$args `echo $1 | sed 's/^-/\//'`"; shift;;
23     x-L*) libsearch="$libsearch `echo $1 | sed 's/^-L//'`"; shift;;
24     x-l*)
25         f="`echo $1 | sed 's/^-l//'`"
26         for dir in . $libsearch; do
27             test -f $dir/$f && args="$args $dir/$f"
28         done
29         shift;;
30     x*) args="$args $1"; shift;;
31     esac
32 done
33
34 case "x$outfile $args" in
35 x/out:*/link*) args="$args $outfile";;
36 x/out:*) args="$args /link $outfile";;
37 x*) args="$args $outfile";;
38 esac
39
40 echo "Translated to: cl /nologo $args"
41 cl /nologo $args
42 retcode=$?
43
44 case "x$nukefiles" in
45  x) nukefiles="";;
46  x*) rm $nukefiles;;
47 esac
48
49 exit $retcode
50
Note: See TracBrowser for help on using the browser.