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