home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!uni-paderborn.de!joost
- From: joost@cadlab.de (Michael Joosten)
- Newsgroups: comp.sys.sgi
- Subject: Re: makedepend that handles libraries properly
- Date: 23 Nov 92 22:06:34
- Organization: CADLAB, Paderborn, FRG
- Lines: 70
- Message-ID: <JOOST.92Nov23220634@ori.cadlab.de>
- References: <1992Nov18.154323.12361@sbctri.sbc.com>
- Reply-To: joost@cadlab.de
- NNTP-Posting-Host: ori.cadlab.uni-paderborn.de
- In-reply-to: stephen_veit@sbctri.sbc.com's message of Wed, 18 Nov 92 15:43:23 GMT
-
- What about this one:
-
- >cat makelibdepend
- #! /bin/sh
-
- trap 1 2 3 15 'rm $$.make'
-
- outfile="Makefile"
- # initialize flags
- see_next_outfile=""
- see_next_library=""
-
-
- #initialize arglist for makedepend
- arglist=""
-
- # get outfile if -f option wa given to makedepend
- for arg
- do
- case $arg in
- -f?*) outfile=`expr $arg : '-f\(.*\)'`
- arglist="$arglist $arg"
- ;;
- -f) see_next_outfile=1
- arglist="$arglist $arg"
- ;;
- -l?*) library=`expr $arg : '-l\(.*\)'`
- ;;
- -l) see_next_lib=1
- ;;
- *) if test $see_next_outfile
- then outfile=$arg;
- see_next_outfile=""
- arglist="$arglist $arg"
- elif test $see_next_lib
- then library=$arg;
- see_next_lib=""
- else
- arglist="$arglist $arg"
- fi
- ;;
- esac
- done
-
- echo Output is $outfile, Library is $library
-
- makedepend $arglist
- mv $outfile $$.make
-
- /bin/sed '/DO NOT DELETE/,$s/^\([A-Za-z0-9]\{1,\}\.o\):/'${library}'(\1):/' < $$.make > $outfile
-
- rm $$.make
-
-
- Invoke it with: makedepend -llibxxx.a -f GNUmakefile .......
-
- For shell gurus: Yes, there might be some rough edges, but I'm more in C/C++
- than in shell programming, so forgive me..
-
- Michael
- --
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- | Michael Joosten | Tel. : (+49) (+) 5251-284 120 |
- | CADLAB | Fax : (+49) (+) 5251-284 140 |
- | Bahnhofstr. 32 | E-Mail: joost@cadlab.de |
- | D-4790 Paderborn | ...!uunet!unido!cadlab!joost |
- | FRG | Mass mail to: joost@pbinfo.uni-paderborn.de |
- |--------------------------------------------------------------------------|
- | CADLAB is a cooperation between Uni-GH Paderborn & SNI AG |
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-