Print this page
10080 smatch Makefile changes for usr/src/cmd
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/cmd-inet/usr.bin/Makefile
+++ new/usr/src/cmd/cmd-inet/usr.bin/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 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 25 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 26 # Copyright 2016 Toomas Soome <tsoome@me.com>
27 +# Copyright (c) 2018, Joyent, Inc.
27 28 #
28 29
29 30 PROG= finger rdate ruptime rwho whois
30 31 SUIDPROG= rcp rlogin rsh
31 32 ALL= $(PROG) $(SUIDPROG)
32 33 SRCS= $(ALL:%=%.c)
33 34 KCMDPROGS= rcp rlogin rsh
34 35
35 36 SUBDIRS= chat dns-sd ftp nc nca netstat \
36 37 pppd pppdump pppstats rdist talk telnet tftp
37 -SUBDIR1= talk
38 +SUBDIR1= talk
38 39 MSGSUBDIRS= nca talk
39 40
40 41 # As programs get lint-clean, add them here. Eventually.
41 42 # This hack should go away, and all in PROG should be lint-clean.
42 43 LINTCLEAN= rlogin.c rsh.c rcp.c rdate.c rwho.c whois.c
43 44
44 45 # Likewise, as subdirs get lint-clean, add them here. Once
45 46 # they're all clean, replace the dependency of the lint target
46 47 # with SUBDIRS. Also (sigh) deal with the commented-out build lines
47 48 # for the lint rule.
48 49 LINTSUBDIRS= nca netstat pppd pppstats tftp
49 50
50 51 include ../../Makefile.cmd
51 52 include ../Makefile.cmd-inet
52 53
53 54 COMMONOBJS= kcmd.o
54 55 COMMONPOFILES= $(COMMONOBJS:.o=.po)
55 56 COMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:.o=.c)
56 57
57 58 POFILES= rlogin.po rsh.po rcp.po $(COMMONPOFILES)
58 59 POFILE= usr.bin.po
59 60
60 61 CLOBBERFILES += $(ALL)
61 62 CLEANFILES += kcmd.o rcp.o rlogin.o rsh.o
62 63
63 64 all:= TARGET= all
64 65 install:= TARGET= install
65 66 clean:= TARGET= clean
66 67 clobber:= TARGET= clobber
67 68 lint:= TARGET= lint
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
68 69 _msg:= TARGET= _msg
69 70
70 71 ROOTSUIDPROG= $(SUIDPROG:%=$(ROOTBIN)/%)
71 72 $(ROOTSUIDPROG) := FILEMODE= 04555
72 73
73 74 CPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP -I$(CMDINETCOMMONDIR)
74 75 CERRWARN += -_gcc=-Wno-parentheses
75 76 CERRWARN += -_gcc=-Wno-uninitialized
76 77 CERRWARN += -_gcc=-Wno-unused-function
77 78
79 +ruptime := SMOFF += leaks
80 +
78 81 # Eventually just plain CFLAGS should be += -v, but not until all in
79 82 # PROGS are lint clean.
80 83 $(LINTCLEAN) := CFLAGS += $(CCVERBOSE)
81 84
82 85 finger := CFLAGS += $(CCVERBOSE)
83 86 # Enable large file support for reading the lastlog file.
84 87 finger := CPPFLAGS += -D_FILE_OFFSET_BITS=64
85 88
86 89 finger := LDLIBS += -lnsl -lcurses -lsocket
87 90 rcp lint-rcp := LDLIBS += -lsocket -lsec -lsendfile
88 91 rdate lint-rdate:= LDLIBS += -lsocket
89 92 rlogin lint-rlogin := LDLIBS += -lnsl -lsocket
90 93 rsh lint-rsh := LDLIBS += -lsocket
91 94 whois lint-whois := LDLIBS += -lsocket
92 95
93 96 include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
94 97 $(KCMDPROGS) := LDLIBS += -lnsl -lmech_krb5
95 98 $(KCMDPROGS) := LDFLAGS += $(ZIGNORE) $(KRUNPATH) \
96 99 -L$(ROOT)$(KLIBDIR_DO) \
97 100 -L$(ROOT)$(KLIBDIR_GL)
98 101 KCMDLINTS= $(KCMDPROGS:%=lint-%)
99 102
100 103 $(COMMONPOFILES) \
101 104 rlogin.po rcp.po rsh.po \
102 105 $(KCMDPROGS) \
103 106 $(KCMDLINTS) := CPPFLAGS += -DKERBEROS \
104 107 -I$(CMDINETCOMMONDIR) \
105 108 -I$(SRC)/lib/gss_mechs/mech_krb5 \
106 109 -I$(SRC)/uts/common/gssapi/mechs/krb5/include \
107 110 -I$(SRC)/lib/gss_mechs/mech_krb5/include \
108 111 -I$(SRC)/lib/gss_mechs/mech_krb5/include/krb5
109 112
110 113 # "-erroff=E_NAME_USED_NOT_DEF2" and "-erroff=E_NAME_DEF_NOT_USED2"
111 114 # are required because lint problems in the Kerberos 5 framework.
112 115 $(KCMDLINTS) := LINTFLAGS += -lnsl \
113 116 -erroff=E_NAME_USED_NOT_DEF2 \
114 117 -erroff=E_NAME_DEF_NOT_USED2
115 118
116 119 # Extra source files to lint with
117 120 LINTXTRA=
118 121 $(KCMDLINTS) := LINTXTRA += $(COMMONSRCS)
119 122
120 123 ROOTSUNWRCP= $(ROOT)/usr/lib/sunw,rcp
121 124 ROOTRSHSYMLINK= $(ROOT)/usr/ucb/rsh
122 125 ROOTREMSHSYMLINK=$(ROOT)/usr/bin/remsh
123 126
124 127 .KEEP_STATE:
125 128
126 129 all: $(ALL) $(SUBDIRS)
127 130
128 131 install: all .WAIT $(ROOTPROG) $(ROOTSUIDPROG) \
129 132 $(SUBDIRS) $(ROOTSUNWRCP) $(ROOTRSHSYMLINK) $(ROOTREMSHSYMLINK)
130 133
131 134 # Messaging - copy $POFILES to $POFILE to work with the parent directory
132 135 # Makefile's '_msg' target.
133 136 #
134 137 _msg: $(MSGSUBDIRS) $(POFILES)
135 138 $(RM) $(POFILE)
136 139 $(CAT) $(POFILES) > $(POFILE)
137 140
138 141 $(COMMONPOFILES): $(COMMONSRCS)
139 142 $(COMPILE.cpp) $(COMMONSRCS) > $(@:.po=.c).i
140 143 $(XGETTEXT) $(XGETFLAGS) $(@:.po=.c).i
↓ open down ↓ |
53 lines elided |
↑ open up ↑ |
141 144 $(RM) $@
142 145 sed "/^domain/d" < messages.po > $@
143 146 $(RM) messages.po $(@:.po=.c).i
144 147
145 148 $(COMMONOBJS): $(COMMONSRCS)
146 149 $(COMPILE.c) $(COMMONSRCS)
147 150
148 151 rlogin: rlogin.o $(COMMONOBJS)
149 152 $(LINK.c) $@.o $(COMMONOBJS) -o $@ $(LDLIBS)
150 153 $(POST_PROCESS)
151 -
154 +
152 155 rcp: rcp.o $(COMMONOBJS)
153 156 $(LINK.c) $@.o $(COMMONOBJS) -o $@ $(LDLIBS)
154 157 $(POST_PROCESS)
155 158
156 159 rsh: rsh.o $(COMMONOBJS)
157 160 $(LINK.c) $@.o $(COMMONOBJS) -o $@ $(LDLIBS)
158 161 $(POST_PROCESS)
159 -
162 +
160 163 $(ROOTSUNWRCP):
161 164 $(RM) $@; $(SYMLINK) ../bin/rcp $@
162 165
163 166 $(ROOTRSHSYMLINK):
164 167 $(RM) $@; $(SYMLINK) ../bin/rsh $@
165 168
166 169 $(ROOTREMSHSYMLINK):
167 170 $(RM) $@; $(SYMLINK) rsh $@
168 171
169 172 $(SUBDIRS): FRC
170 173 @cd $@; pwd; $(MAKE) $(MFLAGS) $(TARGET)
171 174
172 175 FRC:
173 176
174 177 clean: $(SUBDIRS) clean_local
175 178 clean_local:
176 179 $(RM) $(CLEANFILES)
177 180
178 181 clobber: $(SUBDIRS) clobber_local
179 182 clobber_local: clean_local
180 - $(RM) $(CLOBBERFILES)
183 + $(RM) $(CLOBBERFILES)
181 184
182 185 LINTLOCALS= $(LINTCLEAN:%.c=lint-%)
183 186
184 187 lint: $(LINTSUBDIRS) $(LINTLOCALS)
185 188
186 189 $(LINTLOCALS):
187 190 $(LINT.c) $(@:lint-%=%.c) $(LINTXTRA) $(LDLIBS)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX