Print this page
12724 update smatch to 0.6.1-rc1-il-5
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/Makefile
+++ new/usr/src/tools/smatch/Makefile
1 1 #
2 2 # This file and its contents are supplied under the terms of the
3 3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 4 # You may only use this file in accordance with the terms of version
5 5 # 1.0 of the CDDL.
6 6 #
7 7 # A full copy of the text of the CDDL should have accompanied this
8 8 # source. A copy of the CDDL is also available via the Internet at
9 9 # http://www.illumos.org/license/CDDL.
10 10 #
11 11 # Copyright 2020 Joyent, Inc.
12 12 #
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13
14 14 #
15 15 # The src/ sub-directory is un-modified copy of
16 16 # https://github.com/illumos/smatch/tree/$SPARSE_VERSION
17 17 #
18 18 # This Makefile installs just enough for us to be able to run smatch
19 19 # locally.
20 20 #
21 21
22 22 PROG = smatch
23 -SPARSE_VERSION = 0.6.1-rc1-il-4
23 +SPARSE_VERSION = 0.6.1-rc1-il-5
24 24
25 25 include ../Makefile.tools
26 26
27 27 # We have to build smatch before we can use cw
28 28 i386_CC = $(GNUC_ROOT)/bin/gcc
29 29 sparc_CC = $(GNUC_ROOT)/bin/gcc
30 30 # sparc doesn't recognise -msave-args
31 31 i386_SMATCHFLAGS = -msave-args
32 32 sparc_SMATCHFLAGS =
33 33
34 34 # When we use builtins, then ld's -zguidance will complain that libm is
35 35 # unused on x86 because the compiler will replace ceil(3M) with its own copy.
36 36 # However, on SPARC, it doesn't. So for now we disable builtins to make it
37 37 # consistent.
38 38 CFLAGS = -O -m64 -std=gnu99 -nodefaultlibs -D__sun $($(MACH)_SMATCHFLAGS)
39 39 CFLAGS += -fno-builtin
40 40 CFLAGS += -Wall -Wno-unknown-pragmas -Wno-psabi
41 41
42 42 SMATCHDATADIR = $(ROOTONBLDSHARE)/smatch
43 43
44 44 CFLAGS += -DSMATCHDATADIR='"$(SMATCHDATADIR)"'
45 45 CFLAGS += -DGCC_BASE='"/no/such/dir"'
46 46 CFLAGS += -DMULTIARCH_TRIPLET=NULL
47 47
48 48 LDCHECKS = -Wl,$(ZASSERTDEFLIB) -Wl,$(ZGUIDANCE) -Wl,$(ZFATALWARNINGS)
49 49 LDLIBS += -Wl,$(ZLAZYLOAD) -Wl,$(ZDIRECT) -lsqlite3 -lcrypto -lgcc -lm -lc
50 50 LDFLAGS = $(MAPFILE.NES:%=-Wl,-M%)
51 51 LDFLAGS += -L$(NATIVE_ADJUNCT)/lib -R$(NATIVE_ADJUNCT)/lib
52 52
53 53 CPPFLAGS += -nostdinc
54 54 CPPFLAGS += -Isrc/
55 55 CPPFLAGS += -I$(NATIVE_ADJUNCT)/include
56 56
57 57 # no install.bin
58 58 INS.file = $(RM) $@; $(CP) $< $(@D); $(CHMOD) $(FILEMODE) $@
59 59 INS.dir = mkdir -p $@; $(CHMOD) $(DIRMODE) $@
60 60
61 61 # fine for us
62 62 OS=linux
63 63
64 64 LIB_OBJS =
65 65 LIB_OBJS += allocate.o
66 66 LIB_OBJS += builtin.o
67 67 LIB_OBJS += char.o
68 68 LIB_OBJS += compat-$(OS).o
69 69 LIB_OBJS += cse.o
70 70 LIB_OBJS += dissect.o
71 71 LIB_OBJS += dominate.o
72 72 LIB_OBJS += evaluate.o
73 73 LIB_OBJS += expand.o
74 74 LIB_OBJS += expression.o
75 75 LIB_OBJS += flow.o
76 76 LIB_OBJS += flowgraph.o
77 77 LIB_OBJS += inline.o
78 78 LIB_OBJS += ir.o
79 79 LIB_OBJS += lib.o
80 80 LIB_OBJS += linearize.o
81 81 LIB_OBJS += liveness.o
82 82 LIB_OBJS += memops.o
83 83 LIB_OBJS += opcode.o
84 84 LIB_OBJS += optimize.o
85 85 LIB_OBJS += parse.o
86 86 LIB_OBJS += pre-process.o
87 87 LIB_OBJS += ptrlist.o
88 88 LIB_OBJS += ptrmap.o
89 89 LIB_OBJS += scope.o
90 90 LIB_OBJS += show-parse.o
91 91 LIB_OBJS += simplify.o
92 92 LIB_OBJS += sort.o
93 93 LIB_OBJS += ssa.o
94 94 LIB_OBJS += sset.o
95 95 LIB_OBJS += stats.o
96 96 LIB_OBJS += storage.o
97 97 LIB_OBJS += symbol.o
98 98 LIB_OBJS += target.o
99 99 LIB_OBJS += tokenize.o
100 100 LIB_OBJS += unssa.o
101 101 LIB_OBJS += utils.o
102 102 LIB_OBJS += macro_table.o
103 103 LIB_OBJS += token_store.o
104 104 LIB_OBJS += hashtable.o
105 105
106 106 SMATCH_OBJS =
107 107 SMATCH_OBJS += avl.o
108 108 SMATCH_OBJS += smatch_about_fn_ptr_arg.o
109 109 SMATCH_OBJS += smatch_address.o
110 110 SMATCH_OBJS += smatch_annotate.o
111 111 SMATCH_OBJS += smatch_array_values.o
112 112 SMATCH_OBJS += smatch_assigned_expr.o
113 113 SMATCH_OBJS += smatch_bits.o
114 114 SMATCH_OBJS += smatch_buf_comparison.o
115 115 SMATCH_OBJS += smatch_buf_size.o
116 116 SMATCH_OBJS += smatch_capped.o
117 117 SMATCH_OBJS += smatch_common_functions.o
118 118 SMATCH_OBJS += smatch_comparison.o
119 119 SMATCH_OBJS += smatch_conditions.o
120 120 SMATCH_OBJS += smatch_constraints.o
121 121 SMATCH_OBJS += smatch_constraints_required.o
122 122 SMATCH_OBJS += smatch_container_of.o
123 123 SMATCH_OBJS += smatch_data_source.o
124 124 SMATCH_OBJS += smatch_db.o
125 125 SMATCH_OBJS += smatch_equiv.o
126 126 SMATCH_OBJS += smatch_estate.o
127 127 SMATCH_OBJS += smatch_expressions.o
128 128 SMATCH_OBJS += smatch_expression_stacks.o
129 129 SMATCH_OBJS += smatch_extra.o
130 130 SMATCH_OBJS += smatch_files.o
131 131 SMATCH_OBJS += smatch_flow.o
132 132 SMATCH_OBJS += smatch_fresh_alloc.o
133 133 SMATCH_OBJS += smatch_fn_arg_link.o
134 134 SMATCH_OBJS += smatch_function_hooks.o
135 135 SMATCH_OBJS += smatch_function_info.o
136 136 SMATCH_OBJS += smatch_function_ptrs.o
137 137 SMATCH_OBJS += smatch_helper.o
138 138 SMATCH_OBJS += smatch_hooks.o
139 139 SMATCH_OBJS += smatch_ignore.o
140 140 SMATCH_OBJS += smatch_imaginary_absolute.o
141 141 SMATCH_OBJS += smatch_implied.o
142 142 SMATCH_OBJS += smatch_impossible.o
143 143 SMATCH_OBJS += smatch_integer_overflow.o
144 144 SMATCH_OBJS += smatch_kernel_user_data.o
145 145 SMATCH_OBJS += smatch_links.o
146 146 SMATCH_OBJS += smatch_math.o
147 147 SMATCH_OBJS += smatch_mem_tracker.o
148 148 SMATCH_OBJS += smatch_modification_hooks.o
149 149 SMATCH_OBJS += smatch_mtag_data.o
150 150 SMATCH_OBJS += smatch_mtag_map.o
151 151 SMATCH_OBJS += smatch_mtag.o
152 152 SMATCH_OBJS += smatch_nul_terminator.o
153 153 SMATCH_OBJS += smatch_param_cleared.o
154 154 SMATCH_OBJS += smatch_param_compare_limit.o
155 155 SMATCH_OBJS += smatch_parameter_names.o
156 156 SMATCH_OBJS += smatch_param_filter.o
157 157 SMATCH_OBJS += smatch_param_limit.o
158 158 SMATCH_OBJS += smatch_param_set.o
159 159 SMATCH_OBJS += smatch_param_to_mtag_data.o
160 160 SMATCH_OBJS += smatch_param_used.o
161 161 SMATCH_OBJS += smatch_parse_call_math.o
162 162 SMATCH_OBJS += smatch_passes_array_size.o
163 163 SMATCH_OBJS += smatch_project.o
164 164 SMATCH_OBJS += smatch_ranges.o
165 165 SMATCH_OBJS += smatch_real_absolute.o
166 166 SMATCH_OBJS += smatch_recurse.o
167 167 SMATCH_OBJS += smatch_returns.o
168 168 SMATCH_OBJS += smatch_return_to_param.o
169 169 SMATCH_OBJS += smatch_scope.o
170 170 SMATCH_OBJS += smatch_slist.o
171 171 SMATCH_OBJS += smatch_start_states.o
172 172 SMATCH_OBJS += smatch_statement_count.o
173 173 SMATCH_OBJS += smatch_states.o
174 174 SMATCH_OBJS += smatch_stored_conditions.o
175 175 SMATCH_OBJS += smatch_string_list.o
176 176 SMATCH_OBJS += smatch_strings.o
177 177 SMATCH_OBJS += smatch_strlen.o
178 178 SMATCH_OBJS += smatch_struct_assignment.o
179 179 SMATCH_OBJS += smatch_sval.o
180 180 SMATCH_OBJS += smatch_tracker.o
181 181 SMATCH_OBJS += smatch_type_links.o
182 182 SMATCH_OBJS += smatch_type.o
183 183 SMATCH_OBJS += smatch_type_val.o
184 184 SMATCH_OBJS += smatch_unknown_value.o
185 185 SMATCH_OBJS += smatch_untracked_param.o
186 186 SMATCH_OBJS += smatch_var_sym.o
187 187 SMATCH_OBJS += smatch_parsed_conditions.o
188 188
189 189 SMATCH_CHECK_OBJS:sh=ls src/check_*.c | sed -e 's+\.c+.o+;s+src/++;'
190 190
191 191 OBJS = smatch.o $(LIB_OBJS) $(SMATCH_OBJS) $(SMATCH_CHECK_OBJS)
192 192
193 193 SMATCH_DATA = \
194 194 illumos_kernel.skipped_functions \
195 195 illumos_user.skipped_functions
196 196
197 197 SMATCH_DB_DATA =
198 198 SMATCH_DB_DATA += call_implies.schema
199 199 SMATCH_DB_DATA += function_ptr.schema
200 200 SMATCH_DB_DATA += mtag_map.schema
201 201 SMATCH_DB_DATA += caller_info.schema
202 202 SMATCH_DB_DATA += function_type.schema
203 203 SMATCH_DB_DATA += param_map.schema
204 204 SMATCH_DB_DATA += common_caller_info.schema
205 205 SMATCH_DB_DATA += function_type_info.schema
206 206 SMATCH_DB_DATA += parameter_name.schema
207 207 SMATCH_DB_DATA += constraints.schema
208 208 SMATCH_DB_DATA += function_type_size.schema
209 209 SMATCH_DB_DATA += return_implies.schema
210 210 SMATCH_DB_DATA += constraints_required.schema
211 211 SMATCH_DB_DATA += function_type_value.schema
212 212 SMATCH_DB_DATA += return_states.schema
213 213 SMATCH_DB_DATA += data_info.schema
↓ open down ↓ |
180 lines elided |
↑ open up ↑ |
214 214 SMATCH_DB_DATA += local_values.schema
215 215 SMATCH_DB_DATA += sink_info.schema
216 216 SMATCH_DB_DATA += db.schema
217 217 SMATCH_DB_DATA += mtag_about.schema
218 218 SMATCH_DB_DATA += type_info.schema
219 219 SMATCH_DB_DATA += fn_data_link.schema
220 220 SMATCH_DB_DATA += mtag_alias.schema
221 221 SMATCH_DB_DATA += type_size.schema
222 222 SMATCH_DB_DATA += fn_ptr_data_link.schema
223 223 SMATCH_DB_DATA += mtag_data.schema
224 +SMATCH_DB_DATA += mtag_info.schema
224 225 SMATCH_DB_DATA += type_value.schema
225 226
226 227 ROOTONBLDDATAFILES = $(SMATCH_DATA:%=$(SMATCHDATADIR)/smatch_data/%)
227 228 ROOTONBLDDATAFILES += $(SMATCH_DB_DATA:%=$(SMATCHDATADIR)/smatch_data/db/%)
228 229
229 230 BUILT_HEADERS = src/version.h src/check_list_local.h
230 231
231 232 .KEEP_STATE:
232 233
233 234 .PARALLEL: $(OBJS)
234 235
235 236 all: $(PROG)
236 237
237 238 install: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDDATAFILES)
238 239
239 240 clean:
240 241 rm -f $(OBJS) $(BUILT_HEADERS)
241 242
242 243 $(ROOTONBLDDATAFILES): $(SMATCHDATADIR)/smatch_data/db
243 244
244 245 $(SMATCHDATADIR)/smatch_data/%: src/smatch_data/%
245 246 $(INS.file)
246 247
247 248 $(SMATCHDATADIR)/smatch_data/db:
248 249 $(INS.dir)
249 250
250 251 $(SMATCHDATADIR)/smatch_data:
251 252 $(INS.dir)
252 253
253 254 $(PROG): $(OBJS)
254 255 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
255 256 $(POST_PROCESS)
256 257
257 258 %.o: src/%.c $(BUILT_HEADERS)
258 259 $(COMPILE.c) -o $@ $<
259 260
260 261 %.o: src/cwchash/%.c
261 262 $(COMPILE.c) -o $@ $<
262 263
263 264 src/check_list_local.h:
264 265 touch src/check_list_local.h
265 266
266 267 src/version.h:
267 268 echo '#define SPARSE_VERSION "$(SPARSE_VERSION)"' > src/version.h
268 269
269 270 include ../Makefile.targ
↓ open down ↓ |
36 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX