Print this page
10080 smatch Makefile changes for usr/src/cmd
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/modload/Makefile.com
+++ new/usr/src/cmd/modload/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 -# cmd/modload/Makefile.com
25 +# Copyright (c) 2018, Joyent, Inc.
26 26 #
27 27 # makefile for loadable module utilities
28 28
29 29 DRVPROG = add_drv rem_drv update_drv
30 30 MODPROG = modinfo modunload modload
31 31 PROG = $(MODPROG) $(DRVPROG)
32 32
33 33 include ../../Makefile.cmd
34 34
35 35 MODCOMMONOBJ = modsubr.o
36 36 MODCOMMONSRC = $(MODCOMMONOBJ:%.o=../%.c)
37 37
38 38 PLCYOBJ = plcysubr.o
39 39 PLCYSRC = $(PLCYOBJ:%.o=../%.c)
40 40
41 41 $(PLCYOBJ) := CPPFLAGS += -D_REENTRANT
42 42
43 43 ROOTDRVPROG = $(DRVPROG:%=$(ROOTUSRSBIN)/%)
44 44
45 45 DRVCOMMONOBJ = drvsubr.o $(PLCYOBJ)
46 46 DRVCOMMONSRC = $(DRVCOMMONOBJ:%.o=../%.c)
47 47
48 48 OBJECTS = $(MODCOMMONOBJ) $(DRVCOMMONOBJ) $(PROG:%=%.o)
49 49 SRCS = $(OBJECTS:%.o=../%.c)
50 50
51 51 COMMONSRC = $(DRVCOMMONSRC) $(MODCOMMONSRC)
52 52
53 53 CLOBBERFILES = $(PROG)
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
54 54
55 55 # lint is complicated here by the fact that we
56 56 # build multiple commands and with differing
57 57 # common source, drvsubr vs modsubr/plcysubr
58 58 #
59 59 LINT_PROG= $(PROG:%=lint_%.c)
60 60 LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
61 61
62 62 CERRWARN += -_gcc=-Wno-parentheses
63 63
64 +# not linted
65 +SMATCH=off
66 +
64 67 # install specifics
65 68
66 69 $(ROOTDRVPROG) := FILEMODE = 0555
67 70
68 71 add_drv := LDLIBS += -ldevinfo -lelf
69 72 rem_drv := LDLIBS += -ldevinfo
70 73 update_drv := LDLIBS += -ldevinfo
71 74
72 75 lint_add_drv.c := LDLIBS += -ldevinfo -lelf
73 76 lint_rem_drv.c := LDLIBS += -ldevinfo
74 77 lint_update_drv.c := LDLIBS += -ldevinfo
75 78
76 79 .KEEP_STATE:
77 80
78 81 %.o: ../%.c
79 82 $(COMPILE.c) $<
80 83
81 84 all: $(PROG)
82 85
83 86 add_drv: add_drv.o $(DRVCOMMONOBJ)
84 87 $(LINK.c) -o $@ add_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
85 88 $(POST_PROCESS)
86 89
87 90 rem_drv: rem_drv.o $(DRVCOMMONOBJ)
88 91 $(LINK.c) -o $@ rem_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
89 92 $(POST_PROCESS)
90 93
91 94 update_drv: update_drv.o $(DRVCOMMONOBJ)
92 95 $(LINK.c) -o $@ update_drv.o $(DRVCOMMONOBJ) $(LDLIBS)
93 96 $(POST_PROCESS)
94 97
95 98 modload: modload.o $(MODCOMMONOBJ)
96 99 $(LINK.c) -o $@ modload.o $(MODCOMMONOBJ) $(LDLIBS)
97 100 $(POST_PROCESS)
98 101
99 102 modunload: modunload.o $(MODCOMMONOBJ)
100 103 $(LINK.c) -o $@ modunload.o $(MODCOMMONOBJ) $(LDLIBS)
101 104 $(POST_PROCESS)
102 105
103 106 modinfo: modinfo.o $(MODCOMMONOBJ)
104 107 $(LINK.c) -o $@ modinfo.o $(MODCOMMONOBJ) $(LDLIBS)
105 108 $(POST_PROCESS)
106 109
107 110 clean:
108 111 $(RM) $(OBJECTS)
109 112
110 113 lint_%.c:
111 114 $(LINT.c) $(@:lint_%.c=../%.c) $(COMMONSRC) $(LDLIBS)
112 115
113 116 lint: $(LINT_PROG)
114 117
115 118 include ../../Makefile.targ
↓ open down ↓ |
42 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX