home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / sgi / 16794 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  2.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!uni-paderborn.de!joost
  2. From: joost@cadlab.de (Michael Joosten)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: makedepend that handles libraries properly
  5. Date: 23 Nov 92 22:06:34
  6. Organization: CADLAB, Paderborn, FRG
  7. Lines: 70
  8. Message-ID: <JOOST.92Nov23220634@ori.cadlab.de>
  9. References: <1992Nov18.154323.12361@sbctri.sbc.com>
  10. Reply-To: joost@cadlab.de
  11. NNTP-Posting-Host: ori.cadlab.uni-paderborn.de
  12. In-reply-to: stephen_veit@sbctri.sbc.com's message of Wed, 18 Nov 92 15:43:23 GMT
  13.  
  14. What about this one:
  15.  
  16. >cat makelibdepend
  17. #! /bin/sh 
  18.  
  19. trap 1 2 3 15 'rm $$.make'
  20.  
  21. outfile="Makefile"
  22. # initialize flags
  23. see_next_outfile=""
  24. see_next_library=""
  25.  
  26.  
  27. #initialize arglist for makedepend
  28. arglist=""
  29.  
  30. # get outfile if -f option wa given to makedepend
  31. for arg 
  32. do
  33.   case $arg in
  34.     -f?*) outfile=`expr $arg : '-f\(.*\)'`
  35.           arglist="$arglist $arg"
  36.          ;;
  37.     -f) see_next_outfile=1
  38.           arglist="$arglist $arg"
  39.          ;;
  40.     -l?*) library=`expr $arg : '-l\(.*\)'`
  41.          ;;
  42.     -l) see_next_lib=1
  43.          ;;
  44.     *) if test $see_next_outfile
  45.        then outfile=$arg;
  46.             see_next_outfile=""
  47.             arglist="$arglist $arg"
  48.        elif test $see_next_lib
  49.        then library=$arg;
  50.             see_next_lib=""
  51.        else
  52.             arglist="$arglist $arg"
  53.        fi
  54.        ;;
  55.   esac
  56. done
  57.  
  58. echo Output is $outfile, Library is $library
  59.  
  60. makedepend $arglist
  61. mv  $outfile $$.make
  62.  
  63. /bin/sed '/DO NOT DELETE/,$s/^\([A-Za-z0-9]\{1,\}\.o\):/'${library}'(\1):/' < $$.make > $outfile
  64.  
  65. rm $$.make
  66.  
  67.  
  68. Invoke it with: makedepend -llibxxx.a -f GNUmakefile .......
  69.  
  70. For shell gurus: Yes, there might be some rough edges, but I'm more in C/C++
  71. than in shell programming, so forgive me..
  72.  
  73. Michael
  74. --
  75.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  76. | Michael Joosten   |       Tel.  : (+49) (+) 5251-284 120                 |
  77. | CADLAB            |       Fax   : (+49) (+) 5251-284 140                 |
  78. | Bahnhofstr. 32    |       E-Mail: joost@cadlab.de                        |
  79. | D-4790 Paderborn  |                ...!uunet!unido!cadlab!joost           | 
  80. | FRG               | Mass mail to: joost@pbinfo.uni-paderborn.de          |
  81. |--------------------------------------------------------------------------|
  82. | CADLAB is a cooperation between Uni-GH Paderborn & SNI AG                |
  83.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  84.