2 ##############################################################################
3 # Copyright (c) 1998,2000 Free Software Foundation, Inc. #
5 # Permission is hereby granted, free of charge, to any person obtaining a #
6 # copy of this software and associated documentation files (the "Software"), #
7 # to deal in the Software without restriction, including without limitation #
8 # the rights to use, copy, modify, merge, publish, distribute, distribute #
9 # with modifications, sublicense, and/or sell copies of the Software, and to #
10 # permit persons to whom the Software is furnished to do so, subject to the #
11 # following conditions: #
13 # The above copyright notice and this permission notice shall be included in #
14 # all copies or substantial portions of the Software. #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
19 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
22 # DEALINGS IN THE SOFTWARE. #
24 # Except as contained in this notice, the name(s) of the above copyright #
25 # holders shall not be used in advertising or otherwise to promote the sale, #
26 # use or other dealings in this Software without prior written #
28 ##############################################################################
30 # Author: Thomas E. Dickey 1996,1997,2000
32 # $Id: makellib,v 1.8 2000/10/28 21:37:10 tom Exp $
33 # System-dependent wrapper for 'lint' that creates a lint-library via the
34 # following method (XXX is the name of the library):
35 # a. If the file llib-lXXX doesn't exist, create it using the make-rule
36 # b. Process llib-lXXX with the system's lint utility, making
38 # c. Install llib-lXXX.ln in the lib directory.
40 # Using the intermediate file llib-lXXX bypasses a weakness of lint (passing
41 # through warning messages from the original source-files).
43 # There are two drawbacks to this approach:
44 # a. On a few systems, you'll have to manually-edit the llib-lXXX file
45 # to get a usable lint-library (not all C-preprocessors work well).
46 # b. The system's lint utility won't recognize -lXXX as a lint-library
47 # (Use tdlint as a wrapper; it's designed for this).
51 # $* = C-preprocessor options
54 if test "x$ARCH" = "xSunOS" ; then
61 DST
="$HOME/lib/$ARCH/lint"
70 DST
="$DST `echo $1|sed -e 's/^-L//'`"
89 echo '? no library name specified'
96 if test ! -f $llib ; then
105 rm -f $llib.
ln $llib.c
110 CREATE
="-uvxo$LLIB -Nn4000"
120 CREATE
="-g -z -C$LLIB"
125 CREATE
="-DLINTLIBRARY -vxo$LLIB"
130 CREATE
="-DLINTLIBRARY -vxyo$LLIB"
135 CREATE
="-DLINTLIBRARY -vxyo$LLIB"
140 echo "Sorry. I do not know how to build a lint-library for $ARCH"
145 echo TARGET
"$TARGET"
147 if ( lint
$CREATE $OPT $TARGET )
151 for p
in $HOME/lib
$HOME/lib
/$ARCH $HOME/lib
/$ARCH/lint
165 if test "x$TARGET" = "x$llib.c" ; then