1 #
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
6 #
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
10 #
11 # Copyright (c) 2019, Joyent, Inc.
12 #
13
14 #
15 # The src/ sub-directory is un-modified copy of
16 # https://github.com/illumos/smatch/tree/0.5.1-il-3
17 #
18 # This Makefile installs just enough for us to be able to run smatch
19 # locally.
20 #
21
22 PROG = smatch
23 SPARSE_VERSION = 0.5.1-il-3
24
25 include ../Makefile.tools
26
27 # We have to build smatch before we can use cw
28 i386_CC = $(GNUC_ROOT)/bin/gcc
29 sparc_CC = $(GNUC_ROOT)/bin/gcc
30
31 CFLAGS = -O -D__sun -Wall -Wno-unknown-pragmas -std=gnu99 -nodefaultlibs
32
33 SMATCHDATADIR = $(ROOTONBLDSHARE)/smatch
34
35 CFLAGS += -DSMATCHDATADIR='"$(SMATCHDATADIR)"'
36 CFLAGS += -DGCC_BASE='"/no/such/dir"'
37 CFLAGS += -DMULTIARCH_TRIPLET=NULL
38
39 LDLIBS += -lsqlite3 -lcrypto -lm -lgcc -lc
40 LDFLAGS = $(MAPFILE.NES:%=-Wl,-M%)
41 LDFLAGS += -L$(NATIVE_ADJUNCT)/lib -R$(NATIVE_ADJUNCT)/lib
42
43 CPPFLAGS += -nostdinc
44 CPPFLAGS += -Isrc/
45 CPPFLAGS += -I$(NATIVE_ADJUNCT)/include
46
47 # no install.bin
48 INS.file = $(RM) $@; $(CP) $< $(@D); $(CHMOD) $(FILEMODE) $@
49 INS.dir = mkdir -p $@; $(CHMOD) $(DIRMODE) $@
50
51 SMATCH_CHECK_OBJS:sh=ls src/check_*.c | sed -e 's+\.c+.o+;s+src/++;'
60 smatch_equiv.o smatch_buf_size.o smatch_strlen.o smatch_capped.o smatch_db.o \
61 smatch_expressions.o smatch_returns.o smatch_parse_call_math.o \
62 smatch_param_limit.o smatch_param_filter.o \
63 smatch_param_set.o smatch_comparison.o smatch_param_compare_limit.o smatch_local_values.o \
64 smatch_function_ptrs.o smatch_annotate.o smatch_string_list.o \
65 smatch_param_cleared.o smatch_start_states.o \
66 smatch_recurse.o smatch_data_source.o smatch_type_val.o \
67 smatch_common_functions.o smatch_struct_assignment.o \
68 smatch_unknown_value.o smatch_stored_conditions.o avl.o \
69 smatch_function_info.o smatch_links.o smatch_auto_copy.o \
70 smatch_type_links.o smatch_untracked_param.o smatch_impossible.o \
71 smatch_strings.o smatch_param_used.o smatch_container_of.o smatch_address.o \
72 smatch_buf_comparison.o smatch_real_absolute.o smatch_scope.o \
73 smatch_imaginary_absolute.o smatch_parameter_names.o \
74 smatch_return_to_param.o smatch_passes_array_size.o \
75 smatch_constraints.o smatch_constraints_required.o \
76 smatch_fn_arg_link.o smatch_about_fn_ptr_arg.o smatch_mtag.o \
77 smatch_mtag_map.o smatch_mtag_data.o \
78 smatch_param_to_mtag_data.o smatch_mem_tracker.o smatch_array_values.o \
79 smatch_nul_terminator.o smatch_assigned_expr.o smatch_kernel_user_data.o \
80 smatch_statement_count.o
81
82 OBJS += target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
83 expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
84 char.o sort.o allocate.o compat-linux.o ptrlist.o \
85 builtin.o \
86 stats.o \
87 flow.o cse.o simplify.o memops.o liveness.o storage.o unssa.o \
88 dissect.o \
89 macro_table.o token_store.o hashtable.o
90
91 SMATCH_DATA = \
92 illumos_kernel.no_return_funcs \
93 illumos_kernel.skipped_functions \
94 illumos_user.no_return_funcs \
95 illumos_user.skipped_functions
96
97 SMATCH_DB_DATA = \
98 return_states.schema \
99 call_implies.schema \
100 type_value.schema \
|
1 #
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
6 #
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
10 #
11 # Copyright (c) 2019, Joyent, Inc.
12 #
13
14 #
15 # The src/ sub-directory is un-modified copy of
16 # https://github.com/illumos/smatch/tree/0.5.1-il-4
17 #
18 # This Makefile installs just enough for us to be able to run smatch
19 # locally.
20 #
21
22 PROG = smatch
23 SPARSE_VERSION = 0.5.1-il-4
24
25 include ../Makefile.tools
26
27 # We have to build smatch before we can use cw
28 i386_CC = $(GNUC_ROOT)/bin/gcc
29 sparc_CC = $(GNUC_ROOT)/bin/gcc
30
31 CFLAGS = -O -m64 -msave-args -D__sun -Wall -Wno-unknown-pragmas -std=gnu99 -nodefaultlibs
32
33 SMATCHDATADIR = $(ROOTONBLDSHARE)/smatch
34
35 CFLAGS += -DSMATCHDATADIR='"$(SMATCHDATADIR)"'
36 CFLAGS += -DGCC_BASE='"/no/such/dir"'
37 CFLAGS += -DMULTIARCH_TRIPLET=NULL
38
39 LDLIBS += -lsqlite3 -lcrypto -lm -lgcc -lc
40 LDFLAGS = $(MAPFILE.NES:%=-Wl,-M%)
41 LDFLAGS += -L$(NATIVE_ADJUNCT)/lib -R$(NATIVE_ADJUNCT)/lib
42
43 CPPFLAGS += -nostdinc
44 CPPFLAGS += -Isrc/
45 CPPFLAGS += -I$(NATIVE_ADJUNCT)/include
46
47 # no install.bin
48 INS.file = $(RM) $@; $(CP) $< $(@D); $(CHMOD) $(FILEMODE) $@
49 INS.dir = mkdir -p $@; $(CHMOD) $(DIRMODE) $@
50
51 SMATCH_CHECK_OBJS:sh=ls src/check_*.c | sed -e 's+\.c+.o+;s+src/++;'
60 smatch_equiv.o smatch_buf_size.o smatch_strlen.o smatch_capped.o smatch_db.o \
61 smatch_expressions.o smatch_returns.o smatch_parse_call_math.o \
62 smatch_param_limit.o smatch_param_filter.o \
63 smatch_param_set.o smatch_comparison.o smatch_param_compare_limit.o smatch_local_values.o \
64 smatch_function_ptrs.o smatch_annotate.o smatch_string_list.o \
65 smatch_param_cleared.o smatch_start_states.o \
66 smatch_recurse.o smatch_data_source.o smatch_type_val.o \
67 smatch_common_functions.o smatch_struct_assignment.o \
68 smatch_unknown_value.o smatch_stored_conditions.o avl.o \
69 smatch_function_info.o smatch_links.o smatch_auto_copy.o \
70 smatch_type_links.o smatch_untracked_param.o smatch_impossible.o \
71 smatch_strings.o smatch_param_used.o smatch_container_of.o smatch_address.o \
72 smatch_buf_comparison.o smatch_real_absolute.o smatch_scope.o \
73 smatch_imaginary_absolute.o smatch_parameter_names.o \
74 smatch_return_to_param.o smatch_passes_array_size.o \
75 smatch_constraints.o smatch_constraints_required.o \
76 smatch_fn_arg_link.o smatch_about_fn_ptr_arg.o smatch_mtag.o \
77 smatch_mtag_map.o smatch_mtag_data.o \
78 smatch_param_to_mtag_data.o smatch_mem_tracker.o smatch_array_values.o \
79 smatch_nul_terminator.o smatch_assigned_expr.o smatch_kernel_user_data.o \
80 smatch_statement_count.o smatch_bits.o smatch_integer_overflow.o
81
82 OBJS += target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
83 expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
84 char.o sort.o allocate.o compat-linux.o ptrlist.o \
85 builtin.o \
86 stats.o \
87 flow.o cse.o simplify.o memops.o liveness.o storage.o unssa.o \
88 dissect.o \
89 macro_table.o token_store.o hashtable.o
90
91 SMATCH_DATA = \
92 illumos_kernel.no_return_funcs \
93 illumos_kernel.skipped_functions \
94 illumos_user.no_return_funcs \
95 illumos_user.skipped_functions
96
97 SMATCH_DB_DATA = \
98 return_states.schema \
99 call_implies.schema \
100 type_value.schema \
|