#!/bin/sh
##############################################################################
-# Copyright (c) 1998 Free Software Foundation, Inc. #
+# Copyright 2020,2021 Thomas E. Dickey #
+# Copyright 1998,2000 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
# authorization. #
##############################################################################
#
-# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
+# Author: Thomas E. Dickey 1996,1997,2000
#
-# $Id: makellib,v 1.7 1998/02/11 12:13:50 tom Exp $
+# $Id: makellib,v 1.11 2021/09/04 15:49:38 tom Exp $
# System-dependent wrapper for 'lint' that creates a lint-library via the
# following method (XXX is the name of the library):
# a. If the file llib-lXXX doesn't exist, create it using the make-rule
# a. On a few systems, you'll have to manually-edit the llib-lXXX file
# to get a usable lint-library (not all C-preprocessors work well).
# b. The system's lint utility won't recognize -lXXX as a lint-library
-# (Use tdlint as a wrapper; it's designed for this).
+# (Use tdlint as a wrapper; it is designed for this).
#
# Parameters:
# $1 = library name
do
case $1 in
-L*)
- DST="$DST `echo $1|sed -e 's/^-L//'`"
+ DST="$DST `echo "$1"|sed -e 's/^-L//'`"
;;
-*)
OPT="$OPT $1"
llib="llib-l$LLIB"
fi
-if test ! -f $llib ; then
- if ( make $llib )
+if test ! -f "$llib" ; then
+ if ( make "$llib" )
then
:
else
fi
fi
-rm -f $llib.ln $llib.c
+rm -f "$llib.ln" "$llib.c"
TARGET=$LLIB
case "$ARCH" in
AIX)
CREATE="-uvxo$LLIB -Nn4000"
TARGET=$llib.c
- ln $llib $TARGET
+ ln "$llib" "$TARGET"
;;
Solaris)
CREATE="-C$llib"
TARGET=$llib.c
- ln $llib $TARGET
+ ln "$llib" "$TARGET"
+ ;;
+FreeBSD)
+ CREATE="-g -z -C$LLIB"
+ TARGET=$llib.c
+ ln "$llib" "$TARGET"
;;
CLIX)
CREATE="-DLINTLIBRARY -vxo$LLIB"
TARGET=$llib.c
- ln $llib $TARGET
+ ln "$llib" "$TARGET"
;;
IRIX*)
CREATE="-DLINTLIBRARY -vxyo$LLIB"
TARGET=$llib.c
- ln $llib $TARGET
+ ln "$llib" "$TARGET"
;;
UNIX_SV)
CREATE="-DLINTLIBRARY -vxyo$LLIB"
TARGET=$llib.c
- ln $llib $TARGET
+ ln "$llib" "$TARGET"
;;
*)
echo "Sorry. I do not know how to build a lint-library for $ARCH"
echo OPT "$OPT"
echo TARGET "$TARGET"
echo LIBNAME "$llib"
-if ( lint $CREATE $OPT $TARGET )
+if ( lint "$CREATE" "$OPT" "$TARGET" )
then
- if test -f $llib.ln
+ if test -f "$llib.ln"
then
for p in $HOME/lib $HOME/lib/$ARCH $HOME/lib/$ARCH/lint
do
- if test ! -d $p
+ if test ! -d "$p"
then
- mkdir $p
+ mkdir "$p"
fi
done
for p in $DST
do
- cp $llib.ln $p/
+ cp "$llib.ln" "$p/"
done
- rm -f $llib.ln
+ rm -f "$llib.ln"
fi
fi
if test "x$TARGET" = "x$llib.c" ; then
- rm -f $TARGET
+ rm -f "$TARGET"
fi