From 66e3a001ccecccef2737c2b1e353f8024f503f1e Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 10 Oct 1991 14:39:33 +0000 Subject: [PATCH] Added scripts --- bin/.distr | 7 +++++++ bin/cc-and-mkdep.ack | 7 +++++++ bin/cc-and-mkdep.all | 20 +++++++++++++++++++ bin/cc-and-mkdep.sun | 7 +++++++ bin/do_deps | 18 +++++++++++++++++ bin/do_resolve | 47 ++++++++++++++++++++++++++++++++++++++++++++ bin/lint-lib.ack | 12 +++++++++++ bin/lint-lib.unix | 12 +++++++++++ 8 files changed, 130 insertions(+) create mode 100755 bin/cc-and-mkdep.ack create mode 100755 bin/cc-and-mkdep.all create mode 100755 bin/cc-and-mkdep.sun create mode 100755 bin/do_deps create mode 100755 bin/do_resolve create mode 100755 bin/lint-lib.ack create mode 100755 bin/lint-lib.unix diff --git a/bin/.distr b/bin/.distr index 353cf133f..5ce2f213c 100644 --- a/bin/.distr +++ b/bin/.distr @@ -1 +1,8 @@ +cc-and-mkdep.ack +cc-and-mkdep.all +cc-and-mkdep.sun +do_deps +do_resolve em.pascal +lint-lib.ack +lint-lib.unix diff --git a/bin/cc-and-mkdep.ack b/bin/cc-and-mkdep.ack new file mode 100755 index 000000000..ec6fca220 --- /dev/null +++ b/bin/cc-and-mkdep.ack @@ -0,0 +1,7 @@ +: '$Header$' + +: Compile and make dependencies. First argument is the file on which the +: dependencies must be produced. This version is for ACK. +n=$1 +shift +exec $CC -Rcem-d$n -Rcem-m $* diff --git a/bin/cc-and-mkdep.all b/bin/cc-and-mkdep.all new file mode 100755 index 000000000..1aed8acad --- /dev/null +++ b/bin/cc-and-mkdep.all @@ -0,0 +1,20 @@ +: '$Header$' + +: Compile and make dependencies. First argument is the file on which the +: dependencies must be produced. This version is a generic one that should +: work for all Unix systems. +n=$1 +shift +cpp_args= +for i in $* +do + case $i in + -I*|-D*|-U*) cpp_args="$cpp_args $i" + ;; + -*) ;; + *) cpp_args="$cpp_args $i" + ;; + esac +done +$UTIL_HOME/lib.bin/cpp -d $cpp_args > $n +exec $CC $* diff --git a/bin/cc-and-mkdep.sun b/bin/cc-and-mkdep.sun new file mode 100755 index 000000000..c77e5e380 --- /dev/null +++ b/bin/cc-and-mkdep.sun @@ -0,0 +1,7 @@ +: '$Header$' + +: Compile and make dependencies. First argument is the file on which the +: dependencies must be produced. This version is for the SUN cc. +n=$1 +shift +exec $CC -Qpath $UTIL_HOME/lib.bin -Qoption cpp -d$n -Qoption cpp -m $* diff --git a/bin/do_deps b/bin/do_deps new file mode 100755 index 000000000..04b013beb --- /dev/null +++ b/bin/do_deps @@ -0,0 +1,18 @@ +: '$Header$' + +: Produce dependencies for all argument files + +for i in $* +do + n=`basename $i .c` + if [ -f $n.dep ] + then + : + else + echo $n.'$(SUF): '$i > $n.dep + echo " head -5 $n.dep > $n.dp1" >> $n.dep + echo ' CC="$(CC)" UTIL_HOME="$(UTIL_HOME)" $(CC_AND_MKDEP) '$n.dp2 '$(CFLAGS)' -c $i >> $n.dep + echo " cat $n.dp1 $n.dp2 > $n.dep" >> $n.dep + echo " rm -f $n.dp1 $n.dp2" >> $n.dep + fi +done diff --git a/bin/do_resolve b/bin/do_resolve new file mode 100755 index 000000000..3b50dfeb0 --- /dev/null +++ b/bin/do_resolve @@ -0,0 +1,47 @@ +: '$Header$' + +: Resolve name clashes in the files on the argument list. If these +: files reside in another directory, a copy is made in the current +: directory. If not, it is overwritten. Never do this in a source +: directory! A list of the new files is produced on standard output. + +UTIL_BIN=$UTIL_HOME/bin + +trap "rm -f tmp$$ a.out nmclash.* longnames clashes" 0 1 2 3 15 + +: first find out if we have to resolve problems with identifier significance. + +cat > nmclash.c <<'EOF' +/* Accepted if many characters of long names are significant */ +abcdefghijklmnopr() { } +abcdefghijklmnopq() { } +main() { } +EOF +if $CC nmclash.c +then : no identifier significance problem + for i in $* + do + echo $i + done +else + $UTIL_BIN/prid -l7 $* > longnames + + : remove code generating routines from the clashes list. + : code generating routine names start with C_. + : also remove names starting with flt_. + + sed '/^C_/d' < longnames | sed '/^flt_/d' > tmp$$ + $UTIL_BIN/cclash -c -l7 tmp$$ > clashes + for i in $* + do + $UTIL_BIN/cid -Fclashes < $i > tmp$$ + n=`basename $i .xxx` + if cmp -s $n tmp$$ + then + rm -f tmp$$ + else + mv tmp$$ $n + fi + echo $n + done +fi diff --git a/bin/lint-lib.ack b/bin/lint-lib.ack new file mode 100755 index 000000000..e83ec5f7b --- /dev/null +++ b/bin/lint-lib.ack @@ -0,0 +1,12 @@ +: '$Header$' + +: Create a lint library file. The name of the library file is constructed +: from the first argument. The second argument indicates the directory where +: the result is to be placed. This version is for ACK lint. + +n=$1 +shift +d=$1 +shift +lint -L$n $* +mv $n.llb $d diff --git a/bin/lint-lib.unix b/bin/lint-lib.unix new file mode 100755 index 000000000..91c5fc7c5 --- /dev/null +++ b/bin/lint-lib.unix @@ -0,0 +1,12 @@ +: '$Header$' + +: Create a lint library file. The name of the library file is constructed +: from the first argument. The second argument indicates the directory where +: the result is to be placed. This version is for Unix lint. + +n=$1 +shift +d=$1 +shift +/usr/bin/lint -C$n $* +mv llib-l$n.ln $d -- 2.34.1