home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / libg++-2.6-fsf.lha / libg++-2.6 / libg++ / proto-kit / make-source-dependencies < prev    next >
Text File  |  1991-06-28  |  1KB  |  46 lines

  1. #!/bin/sh 
  2. #
  3. # make-source-dependencies:
  4. #        this shell script prints GNU Make compatible
  5. #    input from a list of prototype instantiations read
  6. #    (one per line) from the input.
  7. #
  8. # instantiations instances: /tmp/make-source-dependencies.$$.0
  9. # (cleaned up) instantiation instances: /tmp/make-source-dependencies.$$.1
  10. # sorted list of generic prototypes (culled from above): /tmp/make-source-dependencies.$$.2
  11.  
  12. while read instance ; do
  13. echo "${instance}" 
  14. done >> /tmp/make-source-dependencies.$$.0
  15.  
  16. # instances
  17. cat /tmp/make-source-dependencies.$$.0 | \
  18.   gawk '{ for (i = 1 ; i <= NF ; i ++) print $i ; }' > /tmp/make-source-dependencies.$$.1
  19.  
  20. # prototypes
  21. cat /tmp/make-source-dependencies.$$.0 | \
  22.   gawk -F. '{ print $NF; }' | sort | uniq > /tmp/make-source-dependencies.$$.2
  23.  
  24. for t in `cat /tmp/make-source-dependencies.$$.2` ; do
  25.  
  26.   if [ -f ${PROTO_SOURCE}/${t}.hP ] ; then
  27.     cat /tmp/make-source-dependencies.$$.1 | \
  28.       gawk -F. '$NF == "'${t}'" { printf "$(PC)/%s.h ", $0 ; }' ;
  29.     echo ": \$(${PP})/${t}.hP" ; 
  30.     echo '    $(make-proto-file) $(prepend-proto-includes)' ;
  31.     echo ;
  32.   fi;
  33.  
  34.   if [ -f ${PROTO_SOURCE}/${t}.ccP ] ; then
  35.     cat /tmp/make-source-dependencies.$$.1 | \
  36.       gawk -F. '$NF == "'${t}'" { printf "$(PC)/%s.cc ", $0 ; }' ;
  37.     echo ": \$(${PP})/${t}.ccP" ; 
  38.     echo '    $(make-proto-file)' ;
  39.     echo ;
  40.   fi;
  41. done;
  42.  
  43. rm -f /tmp/make-source-dependencies.$$.0
  44. rm -f /tmp/make-source-dependencies.$$.1
  45. rm -f /tmp/make-source-dependencies.$$.2
  46.