Print this page
10077 usr/src/uts/ Makefile changes for smatch
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/nsmb/Makefile
+++ new/usr/src/uts/intel/nsmb/Makefile
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.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 #
22 22 # uts/intel/nsmb/Makefile
23 23 #
24 24 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 +# Copyright (c) 2018, Joyent, Inc.
27 28
28 29 #
29 30 # intel architecture dependent
30 31 #
31 32
32 33 #
33 34 # Path to the base of the uts directory tree (usually /usr/src/uts).
34 35 #
35 36 UTSBASE = ../..
36 37
37 38 #
38 39 # Define the module and object file sets.
39 40 #
40 41 MODULE = nsmb
41 42 OBJECTS = $(NSMB_OBJS:%=$(OBJS_DIR)/%)
42 43 LINTS = $(NSMB_OBJS:%.o=$(LINTS_DIR)/%.ln)
43 44 ROOTMODULE = $(USR_DRV_DIR)/$(MODULE)
44 45 CONF_SRCDIR = $(UTSBASE)/common/fs/smbclnt/netsmb
45 46 OFFSETS_SRC = $(CONF_SRCDIR)/offsets.in
46 47 IOC_CHECK_H = $(OBJS_DIR)/ioc_check.h
47 48
48 49 #
49 50 # Include common rules.
50 51 #
51 52 include $(UTSBASE)/intel/Makefile.intel
52 53
53 54 #
54 55 # Define targets
55 56 #
56 57 ALL_TARGET = $(ALL_TARGET_$(OBJS_DIR))
57 58 LINT_TARGET = $(MODULE).lint
58 59 INSTALL_TARGET = $(INSTALL_TARGET_$(OBJS_DIR))
59 60
60 61 #
61 62 # Overrides.
62 63 #
63 64 # We need some unusual overrides here so we'll
64 65 # build ioc_check.h for both 32-bit/64-bit,
65 66 # but only build 64-bit binaries.
66 67 #
67 68
68 69 # Build 32-bit also...
69 70 DEF_BUILDS = $(DEF_BUILDS64) $(DEF_BUILDS32)
70 71 ALL_BUILDS = $(ALL_BUILDS64) $(ALL_BUILDS32)
71 72 # ... but don't build any 32-bit objects
72 73 ALL_TARGET_debug32 = $(IOC_CHECK_H)
73 74 ALL_TARGET_debug64 = $(BINARY) $(SRC_CONFILE)
74 75 ALL_TARGET_obj32 = $(IOC_CHECK_H)
75 76 ALL_TARGET_obj64 = $(BINARY) $(SRC_CONFILE)
76 77 # ... and remove -xcg92 (not supported by cw)
77 78 CFLAGS_32=
78 79 # ... same deal for install targets
79 80 INSTALL_TARGET_debug32 = $(IOC_CHECK_H)
80 81 INSTALL_TARGET_debug64 = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
81 82 INSTALL_TARGET_obj32 = $(IOC_CHECK_H)
82 83 INSTALL_TARGET_obj64 = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
83 84
84 85 #
85 86 # Now the normal overrides...
86 87 #
87 88 MODSTUBS_DIR = $(OBJS_DIR)
88 89 $(MODSTUBS_O) := AS_CPPFLAGS += -DNSMB_MODULE
89 90 CLEANFILES += $(MODSTUBS_O) $(IOC_CHECK_H)
90 91 CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
91 92 INC_PATH += -I$(UTSBASE)/common/fs/smbclnt
↓ open down ↓ |
55 lines elided |
↑ open up ↑ |
92 93 LDFLAGS += -dy -Ncrypto/md4 -Ncrypto/md5 -Nmisc/tlimod
93 94
94 95 # Until CR 4994570 is fixed...
95 96 LINTTAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2
96 97
97 98 # The mb_put/md_get functions are intentionally used with and without
98 99 # return value checks, so filter those out like LGREP.2 does.
99 100 LGREP.nsmb = egrep -v ' ignored: (mb_init|mb_put|md_get)'
100 101 LTAIL += 2>&1 | $(LGREP.2) | $(LGREP.nsmb) || true
101 102
103 +# same for smatch
104 +SMOFF += all_func_returns
105 +
106 +# needs work
107 +SMOFF += signed,deref_check
108 +
102 109 #
103 110 # Default build targets.
104 111 #
105 112 .KEEP_STATE:
106 113
107 114 def: $(DEF_DEPS)
108 115
109 116 all: $(ALL_DEPS)
110 117
111 118 clean: $(CLEAN_DEPS)
112 119
113 120 clobber: $(CLOBBER_DEPS)
114 121
115 122 lint: $(LINT_DEPS)
116 123
117 124 modlintlib: $(MODLINTLIB_DEPS)
118 125
119 126 clean.lint: $(CLEAN_LINT_DEPS)
120 127
121 128 install: $(INSTALL_DEPS)
122 129
123 130 #
124 131 # Create ioc_check.h and compare with the saved
125 132 # ioc_check.ref to ensure 32/64-bit invariance.
126 133 #
127 134 $(OBJECTS) : $(IOC_CHECK_H)
128 135 $(IOC_CHECK_H): $(OFFSETS_SRC)
129 136 $(OFFSETS_CREATE) <$(OFFSETS_SRC) >$@.tmp
130 137 cmp -s ioc_check.ref $@.tmp && \
131 138 mv -f $@.tmp $@
132 139
133 140 #
134 141 # Include common targets.
135 142 #
136 143 include $(UTSBASE)/intel/Makefile.targ
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX