home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / metrics / part14 < prev    next >
Encoding:
Internet Message Format  |  1989-09-18  |  2.9 KB

  1. Subject:  v20i021:  Tools for generating software metrics, Part14/14
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Brian Renaud <huron.ann-arbor.mi.us!bdr>
  7. Posting-number: Volume 20, Issue 21
  8. Archive-name: metrics/part14
  9.  
  10. ---- Cut Here and unpack ----
  11. #!/bin/sh
  12. # this is part 14 of a multipart archive
  13. # do not concatenate these parts, unpack them in order with /bin/sh
  14. # file src/utils/stripstr.c continued
  15. #
  16. CurArch=14
  17. if test ! -r s2_seq_.tmp
  18. then echo "Please unpack part 1 first!"
  19.      exit 1; fi
  20. ( read Scheck
  21.   if test "$Scheck" != $CurArch
  22.   then echo "Please unpack part $Scheck next!"
  23.        exit 1;
  24.   else exit 0; fi
  25. ) < s2_seq_.tmp || exit 1
  26. echo "x - Continuing file src/utils/stripstr.c"
  27. sed 's/^X//' << 'SHAR_EOF' >> src/utils/stripstr.c
  28. X    exit(0);
  29. X}
  30. X
  31. XFILE *
  32. Xnextfp( argc, argv, p_filename)
  33. X    int    argc;
  34. X    char    *argv[];
  35. X    char    **p_filename;
  36. X{
  37. X    /* looks through parameters trying to return next FILE * to next
  38. X     * specified file
  39. X     * passes back a pointer to the filename as a side effect
  40. X     */
  41. X    
  42. X    static Bool    first = True;
  43. X    static int    index = 1;
  44. X    static FILE    *result = FNULL;
  45. X
  46. X    *p_filename = CNULL;
  47. X
  48. X    if ( result != FNULL )
  49. X    {
  50. X        fclose( result );
  51. X        result = FNULL;
  52. X    }
  53. X    while ( index < argc && *argv[index] == '-' )
  54. X        index++;
  55. X
  56. X    if ( index < argc )
  57. X    {
  58. X        if ( (result = fopen( argv[index], "r")) == NULL )
  59. X        {
  60. X            fprintf(stderr, "%s: unable to open %s for read\n",
  61. X                argv[0], argv[index]);
  62. X            exit(1);
  63. X        }
  64. X        else
  65. X            *p_filename = argv[index];
  66. X        index++;
  67. X    }
  68. X    if ( first )
  69. X    {
  70. X        /* if no files specified, read from stdin */
  71. X        /* filename remains null */
  72. X        if ( result == FNULL )
  73. X            result = stdin;
  74. X        first = False;
  75. X    }
  76. X    return ( result );
  77. X}
  78. SHAR_EOF
  79. echo "File src/utils/stripstr.c is complete"
  80. chmod 0644 src/utils/stripstr.c || echo "restore of src/utils/stripstr.c fails"
  81. echo "x - extracting src/Makefile (Text)"
  82. sed 's/^X//' << 'SHAR_EOF' > src/Makefile
  83. X# master make for metrics
  84. X
  85. X# where to put binaries (from the perspective of our subdirectories)
  86. XBIN=../bin
  87. X
  88. XDIRS= mccabe halstead utils kdsi
  89. X
  90. XCFLAGS=-O
  91. XLDFLAGS=
  92. X
  93. Xall:     clean  progs install
  94. X
  95. Xprogs:
  96. X    cd kdsi; $(MAKE) -e kdsi
  97. X    cd utils; $(MAKE) -e all
  98. X    cd halstead; $(MAKE) -e all
  99. X    cd mccabe; $(MAKE)  -e all
  100. X    @echo metrics software made
  101. X
  102. Xinstall:
  103. X    cd kdsi; $(MAKE) install BIN=$(BIN)
  104. X    cd utils; $(MAKE) install BIN=$(BIN)
  105. X    cd halstead; $(MAKE) install BIN=$(BIN)
  106. X    cd mccabe; $(MAKE) install BIN=$(BIN)
  107. X    @echo metrics software installed
  108. X
  109. Xclean:
  110. X    for i in $(DIRS); do (cd $$i; $(MAKE) clean); done;
  111. X
  112. Xtest:
  113. X    @echo testing kdsi
  114. X    @cd kdsi;  PATH=$(BIN):$$PATH; export PATH; $(MAKE) -i test
  115. X    @echo " "
  116. X    @echo testing halstead
  117. X    @cd halstead;  PATH=$(BIN):$$PATH; export PATH; $(MAKE) -i test
  118. X    @echo " "
  119. X    @echo test mccabe
  120. X    @cd mccabe;  PATH=$(BIN):$$PATH; export PATH; $(MAKE) -i test
  121. SHAR_EOF
  122. chmod 0644 src/Makefile || echo "restore of src/Makefile fails"
  123. rm -f s2_seq_.tmp
  124. echo "You have unpacked the last part"
  125. exit 0
  126.  
  127.  
  128.