Print this page
10080 smatch Makefile changes for usr/src/cmd
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/fs.d/Makefile
+++ new/usr/src/cmd/fs.d/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.
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
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
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 # Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
22 +# Copyright (c) 2018, Joyent, Inc.
22 23 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
23 24 #
24 25
25 26 # The filesystem independent utilities clri, fsdb, dcopy, labelit, and mkfs
26 27 # are all built from the source file switchout.c. They are all then links
27 28 # to the same object. This is accomplished by:
28 29 # 1) building clri from switchout.c (had to choose one)
29 30 # 2) installing it in the target directory
30 31 # 3) linking the others to clri.
31 32 # In a similar manner, ncheck is linked to ff.
32 33
33 34 DFPROG= df
34 35 PROG= $(DFPROG) fsck volcopy ff
35 36 ROOTFS_PROG= mount umount
36 37 SPPROG= clri
37 38 MNTTAB= mnttab
38 39 DEFAULTFILES= fs.dfl
39 40
40 41 include ../Makefile.cmd
41 42
42 43 SUBDIR1= bootfs lofs zfs
43 44 SUBDIR2= dev fd pcfs nfs hsfs proc ctfs udfs ufs tmpfs \
44 45 autofs mntfs objfs sharefs smbclnt reparsed
45 46 SUBDIRS= $(SUBDIR1) $(SUBDIR2)
46 47 I18NDIRS= $(SUBDIR2)
47 48
48 49 CLEANFILES += deffs.o df.o ff.o fsck.o fssnapsup.o \
49 50 mount.o preenlib.o switchout.o umount.o volcopy.o
50 51
51 52 all:= TARGET= all
52 53 install:= TARGET= install
53 54 clean:= TARGET= clean
54 55 clobber:= TARGET= clobber
55 56 lint:= TARGET= lint
56 57 _msg:= TARGET= catalog
57 58
58 59 USRSBINF= df clri fsck volcopy ff
59 60 USRSBINCLRI= dcopy fsdb fssnap labelit mkfs
60 61 USRSBINFF= ncheck
61 62
62 63 ETC2SBIN= mount umount
63 64 ETC2USRSBIN= clri fsdb mkfs fsck labelit dcopy volcopy ff ncheck
64 65 USRBIN2USRSBIN= df
65 66 USRXPG4BIN2USRSBIN= df
66 67
67 68 FSLIB= fslib.o
68 69
69 70 ROOTSBINPROG = $(ROOTFS_PROG:%=$(ROOTSBIN)/%)
70 71 ROOTUSRSBINLINKS = $(ROOTFS_PROG:%=$(ROOTUSRSBIN)/%)
71 72
72 73 ROOTUSRSBINF= $(USRSBINF:%=$(ROOTUSRSBIN)/%)
73 74 ROOTUSRSBINCLRI= $(USRSBINCLRI:%=$(ROOTUSRSBIN)/%)
74 75 ROOTUSRSBINFF= $(USRSBINFF:%=$(ROOTUSRSBIN)/%)
75 76 ROOTETCMNTTAB= $(MNTTAB:%=$(ROOTETC)/%)
76 77 SYMETC2SBIN = $(ETC2SBIN:%=$(ROOTETC)/%)
77 78 SYMETC2USRSBIN = $(ETC2USRSBIN:%=$(ROOTETC)/%)
78 79 SYMUSRBIN2USRSBIN= $(USRBIN2USRSBIN:%=$(ROOTBIN)/%)
79 80 SYMUSRXPG4BIN2USRSBIN= $(USRXPG4BIN2USRSBIN:%=$(ROOTXPG4BIN)/%)
↓ open down ↓ |
48 lines elided |
↑ open up ↑ |
80 81 SYMDEVNM= $(ROOTUSRSBIN)/devnm
81 82
82 83 CPPFLAGS += -D_LARGEFILE64_SOURCE
83 84
84 85 CERRWARN += -_gcc=-Wno-implicit-function-declaration
85 86 CERRWARN += -_gcc=-Wno-parentheses
86 87 CERRWARN += -_gcc=-Wno-unused-variable
87 88 CERRWARN += -_gcc=-Wno-uninitialized
88 89 CERRWARN += -_gcc=-Wno-unused-function
89 90
91 +# not linted
92 +SMATCH=off
93 +
90 94 $(DFPROG) := LDLIBS += -lcmdutils
91 95 $(SPPROG) := LDLIBS += -lkstat
92 96
93 97 $(ROOTETCMNTTAB) := FILEMODE = 444
94 98
95 99 # for messaging catalog
96 100 #
97 101 POFILE= fs.d.po
98 102 POFILES1= $(PROG:%=%.po) $(ROOTFS_PROG:%=%.po) switchout.po fssnapsup.po
99 103 POFILES2= $(I18NDIRS:%=%/%.po)
100 104 POFILES= $(POFILES1) $(POFILES2)
101 105 volcopy.po := XGETFLAGS += -a -x volcopy.xcl
102 106 $(DFPROG).po := XGETFLAGS += -a -x df.xcl
103 107
104 108 .KEEP_STATE:
105 109
106 110 # This is too intense when building the whole world.
107 111 # .PARALLEL: $(SUBDIRS)
108 112
109 113 all: $(FSLIB) .WAIT $(SUBDIRS) .WAIT all_local
110 114
111 115 _msg: $(I18NDIRS) $(POFILES1)
112 116 $(RM) $(POFILE)
113 117 cat $(POFILES) > $(POFILE)
114 118 $(RM) $(MSGDOMAIN)/$(POFILE)
115 119 cp $(POFILE) $(MSGDOMAIN)
116 120
117 121 all_local: $(PROG) $(ROOTFS_PROG) $(SPPROG) $(MNTTAB) \
118 122 $(DEFAULTFILES)
119 123
120 124 ff volcopy: deffs.o $$(@F).o
121 125 $(LINK.c) -o $@ $@.o deffs.o $(LDLIBS)
122 126 $(POST_PROCESS)
123 127
124 128 df: deffs.o $(FSLIB) $$(@F).o
125 129 $(LINK.c) -o $@ $@.o deffs.o $(FSLIB) $(LDLIBS)
126 130 $(POST_PROCESS)
127 131
128 132 fsck: fsck.o deffs.o preenlib.o
129 133 $(LINK.c) -o $@ fsck.o deffs.o preenlib.o $(LDLIBS)
130 134 $(POST_PROCESS)
131 135
132 136 mount: deffs.o mount.o $(FSLIB)
133 137 $(LINK.c) -o $@ mount.o deffs.o $(FSLIB) $(LDLIBS)
134 138 $(POST_PROCESS)
135 139
136 140 umount: umount.o $(FSLIB)
137 141 $(LINK.c) -o $@ umount.o $(FSLIB) $(LDLIBS)
138 142 $(POST_PROCESS)
139 143
140 144 $(SPPROG): switchout.o deffs.o fssnapsup.o
141 145 $(LINK.c) -o $@ switchout.o deffs.o fssnapsup.o $(LDLIBS) -ldiskmgt
142 146 $(POST_PROCESS)
143 147
144 148 install: $(FSLIB) .WAIT $(SUBDIRS) .WAIT install_local
145 149
146 150 install_local: all_local $(ROOTSBINPROG) $(ROOTUSRSBINF) $(ROOTUSRSBINCLRI) \
147 151 $(ROOTUSRSBINFF) $(ROOTETCMNTTAB) $(ROOTETCDEFAULTFILES) \
148 152 $(SYMETC2SBIN) $(SYMETC2USRSBIN) \
149 153 $(SYMUSRBIN2USRSBIN) $(SYMUSRXPG4BIN2USRSBIN) $(SYMDEVNM) \
150 154 $(ROOTUSRSBINLINKS)
151 155
152 156 # Links from /etc to /sbin such as /etc/mount -> ../sbin/mount
153 157 $(SYMETC2SBIN):
154 158 -$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
155 159
156 160 # Links from /etc to /usr/sbin such as /etc/clri -> ../usr/sbin/clri
157 161 $(SYMETC2USRSBIN):
158 162 -$(RM) $@; $(SYMLINK) ../usr/sbin/$(@F) $@
159 163
160 164 # Links from /usr/bin to /usr/sbin such as /usr/bin/df -> ../sbin/df
161 165 $(SYMUSRBIN2USRSBIN):
162 166 -$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
163 167
164 168 # Links from /usr/xpg4/bin to /usr/sbin such as /usr/xpg4/bin/df -> ../sbin/df
165 169 $(SYMUSRXPG4BIN2USRSBIN):
166 170 -$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
167 171
168 172 # Links from /usr/sbin to /sbin such as /usr/sbin/mount -> ../../sbin/mount
169 173 $(ROOTUSRSBINLINKS):
170 174 -$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
171 175
172 176 # Symlink from devnm to df in /usr/sbin
173 177 $(SYMDEVNM):
174 178 -$(RM) $@; $(SYMLINK) ./df $@
175 179
176 180 # Multiple names for switchout (clri, dcopy, fsdb, labelit, mkfs)
177 181 $(ROOTUSRSBINCLRI): $(ROOTUSRSBIN)/clri
178 182 -$(RM) $@; $(SYMLINK) ./clri $@
179 183
180 184 $(MNTTAB):
181 185 touch $(MNTTAB)
182 186
183 187 fs.dfl:
184 188 $(RM) $@; $(ECHO) "LOCAL=ufs" >$@
185 189
186 190 # Multiple names for ff (ncheck)
187 191 $(ROOTUSRSBINFF): $(ROOTUSRSBIN)/ff
188 192 -$(RM) $@; $(SYMLINK) ./ff $@
189 193
190 194 clean: $(SUBDIRS) .WAIT clean_local
191 195 clean_local:
192 196 $(RM) $(CLEANFILES)
193 197
194 198 clobber: $(SUBDIRS) .WAIT clobber_local
195 199 clobber_local: clean_local
196 200 $(RM) $(PROG) $(ROOTFS_PROG) $(SPPROG) $(MNTTAB) $(DEFAULTFILES) \
197 201 $(CLOBBERFILES)
198 202
199 203 lint:
200 204
201 205 $(SUBDIRS): FRC
202 206 @cd $@; pwd; $(MAKE) $(MFLAGS) $(TARGET)
203 207
204 208 FRC:
↓ open down ↓ |
105 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX