Print this page
10079 smatch Makefile changes for usr/src/lib
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/fm/libfmd_msg/Makefile.com
+++ new/usr/src/lib/fm/libfmd_msg/Makefile.com
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 #
22 22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 +# Copyright (c) 2018, Joyent, Inc.
25 26
26 27 LIBRARY = libfmd_msg.a
27 28 VERS = .1
28 29
29 30 LIBSRCS = fmd_msg.c
30 31 OBJECTS = $(LIBSRCS:%.c=%.o)
31 32
32 33 include ../../../Makefile.lib
33 34 include ../../Makefile.lib
34 35
35 36 SRCS = $(LIBSRCS:%.c=../common/%.c)
36 37 LIBS = $(DYNLIB) $(LINTLIB)
37 38
38 39 SRCDIR = ../common
39 40
40 41 CPPFLAGS += -I../common -I.
41 42 CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
42 43 CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS)
43 44 CERRWARN += -_gcc=-Wno-switch
44 45 CERRWARN += -_gcc=-Wno-uninitialized
46 +
47 +SMOFF += all_func_returns
48 +
45 49 LDLIBS += -lnvpair -lc
46 50
47 51 LINTFLAGS = -msux
48 52 LINTFLAGS64 = -msux -m64
49 53
50 54 CLOBBERFILES += fmd_msg_test fmd_msg_test.core fmd_msg_test.out
51 55
52 56 $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
53 57 $(LINTLIB) := LINTFLAGS = -nsvx
54 58 $(LINTLIB) := LINTFLAGS64 = -nsvx -m64
55 59
56 60 .KEEP_STATE:
57 61
58 62 all: $(LIBS)
59 63
60 64 lint: $(LINTLIB) lintcheck
61 65
62 66 include ../../../Makefile.targ
63 67 include ../../Makefile.targ
64 68
65 69 LDLIBS_$(MACH) = -L$(ROOT)/usr/lib/fm -R$(ROOT)/usr/lib/fm
66 70 LDLIBS_$(MACH64) = -L$(ROOT)/usr/lib/fm/$(MACH64) -R$(ROOT)/usr/lib/fm/$(MACH64)
67 71
68 72 #
69 73 # To ease the development and maintenance of libfmd_msg, a test suite is built
70 74 # directly into the library. The test program fmd_msg_test.c includes a set of
71 75 # tests for all the code paths in the library. The test program executes the
72 76 # calls, and then forks into the background and dumps core. After the test
73 77 # runs, we diff the output against the master hand-verified output, and confirm
74 78 # no leaks or corruption exist. To run the entire suite, type "make test" and
75 79 # inspect the results (the make target will fail on an error).
76 80 #
77 81 # The cmp skips the first 900 bytes of $(SRCDIR)/fmd_msg_test.out to get us
78 82 # passed the CDDL header and copyright in that file.
79 83 #
80 84 test: install fmd_msg_test
81 85 @echo; echo "Running `pwd | sed 's/.*\///'` fmd_msg test suite ... \c"
82 86 @coreadm -p core $$$$
83 87 @UMEM_DEBUG=default,verbose UMEM_LOGGING=fail,contents LANG=C \
84 88 LC_ALL=C ./fmd_msg_test | grep -v EVENT-TIME > fmd_msg_test.out
85 89 @chmod 0444 core; mv -f core fmd_msg_test.core
86 90 @echo; echo "Checking test output ... \c"
87 91 @cmp -s $(SRCDIR)/fmd_msg_test.out fmd_msg_test.out 900 0 && echo pass \
88 92 || ( echo FAIL && diff $(SRCDIR)/fmd_msg_test.out fmd_msg_test.out )
89 93 @echo; echo Checking for memory leaks:
90 94 @echo ::findleaks | mdb fmd_msg_test.core
91 95 @echo; echo Checking for latent corruption:
92 96 @echo ::umem_verify | mdb fmd_msg_test.core | grep -v clean
93 97 @echo
94 98
95 99 fmd_msg_test: $(SRCDIR)/fmd_msg_test.c
96 100 $(LINT.c) $(SRCDIR)/fmd_msg_test.c
97 101 $(LINK.c) -o fmd_msg_test $(SRCDIR)/fmd_msg_test.c \
98 102 $(LDLIBS_$(TARGETMACH)) -lfmd_msg -lnvpair -lumem
↓ open down ↓ |
44 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX