Cross Reference: /illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/Makefile
Makefile revision 7c478bd95313f5f23a4c958a745db2134aa03244
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
SYNCPROG= syncinit syncloop syncstat
DHCPPROG= dhcpconfig dhtadm pntadm
# EXPORT DELETE START
XMODPROG= wanbootutil
# EXPORT DELETE END
PROG= 6to4relay arp gettable if_mpadm ikeadm ikecert \
in.comsat in.fingerd in.rarpd in.rdisc in.rexecd in.rlogind \
in.rshd in.rwhod in.telnetd in.tftpd in.tnamed ipaddrsel \
ipsecalgs ipsecconf ipseckey ndd $(SYNCPROG) $(DHCPPROG) \
$(XMODPROG)
MANIFEST= rarp.xml telnet.xml comsat.xml finger.xml \
login.xml shell.xml rexec.xml tname.xml
ROOTFS_PROG= hostconfig route routeadm soconfig
SBINLINKS= hostconfig route routeadm
RPCSVCPROG= hostconfig
AUDITPROG= in.rexecd in.rlogind in.rshd in.telnetd
PAMPROG= in.rexecd in.rlogind in.rshd in.telnetd
SOCKETPROG= 6to4relay arp gettable hostconfig if_mpadm in.comsat \
in.fingerd in.rarpd in.rdisc in.rexecd in.rlogind in.rshd \
in.rwhod in.telnetd in.tftpd in.tnamed ipaddrsel \
ipsecalgs ipsecconf ipseckey route routeadm
NSLPROG= 6to4relay arp gettable hostconfig ikeadm in.comsat in.rarpd \
in.rdisc in.rexecd in.rlogind in.rshd in.rwhod in.telnetd \
in.tftpd in.tnamed ipaddrsel ipsecalgs ipsecconf ipseckey route
CMDPROG= in.telnetd
IPSECUTILPROG= ikeadm ipsecalgs ipsecconf ipseckey
K5PROGS= in.telnetd in.rlogind in.rshd
DEFAULTFILES= telnetd
PROGSRCS= $(PROG:%=%.c)
TFTPDOBJS= in.tftpd.o tftpsubs.o
OTHERSRC= ../usr.bin/tftp/tftpsubs.c
K5RLOGINOBJS= in.rlogind.o
K5RSHDOBJS= in.rshd.o
SRCS= $(PROGSRCS) $(OTHERSRC)
SUBDIRS= bootconfchk htable ifconfig in.ftpd in.routed \
in.talkd inetadm inetconv ipqosconf mipagentconfig \
mipagentstat ping snoop sppptun traceroute
MSGSUBDIRS= bootconfchk htable ifconfig in.ftpd in.routed in.talkd \
inetadm inetconv ipqosconf mipagentconfig mipagentstat \
sppptun snoop
# As programs get lint-clean, add them here and to the 'lint' target.
# Eventually this hack should go away, and all in PROG should be
# lint-clean.
LINTCLEAN= 6to4relay arp ikeadm in.rlogind in.rshd in.telnetd in.tftpd \
ipaddrsel ipsecalgs ipseckey ipsecconf route routeadm \
in.rarpd $(SYNCPROG)
# Likewise, as subdirs get lint-clean, add them here. Once
# they're all clean, replace the dependency of the lint target
# with SUBDIRS. Also (sigh) deal with the commented-out build lines
# for the lint rule.
LINTSUBDIRS= bootconfchk in.routed in.talkd inetadm inetconv ipqosconf \
mipagentstat ping sppptun traceroute
# And as programs are verified not to attempt to write into constants,
# -xstrconst should be used to ensure they stay that way.
CONSTCLEAN= ikeadm
include ../../Makefile.cmd
ROOTMANIFESTDIR= $(ROOTSVCNETWORK)
$(ROOTMANIFEST) := FILEMODE= 444
include ../Makefile.cmd-inet
ROOTSBINPROG = $(ROOTFS_PROG:%=$(ROOTSBIN)/%)
ROOTUSRSBINLINKS = $(SBINLINKS:%=$(ROOTUSRSBIN)/%)
COMMONOBJS= kcmd.o
COMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:.o=.c)
SRCS+= $(COMMONSRCS)
#
# Message catalog
#
POFILES= 6to4relay.po if_mpadm.po ikeadm.po in.comsat.po ipaddrsel.po \
ipsecalgs.po ipsecconf.po ipseckey.po route.po routeadm.po
POFILE= usr.sbin.po
all:= TARGET= all
install:= TARGET= install
clean:= TARGET= clean
clobber:= TARGET= clobber
lint:= TARGET= lint
_msg:= TARGET= _msg
CLOBBERFILES += $(ROOTFS_PROG) $(PROG)
CLEANFILES += $(COMMONOBJS) $(K5RLOGINOBJS) $(K5RSHDOBJS) $(TFTPDOBJS)
CPPFLAGS += -DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I.
include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
K5LIBS=
# Eventually just plain CFLAGS should be += -v, but not until all in
# PROGS are lint clean.
$(LINTCLEAN) := CFLAGS += $(CCVERBOSE)
$(CONSTCLEAN) := CFLAGS += $(XSTRCONST)
$(SYNCPROG) := LDLIBS += -ldlpi
$(SOCKETPROG) := LDLIBS += -lsocket
$(NSLPROG) := LDLIBS += -lnsl
$(AUDITPROG) := LDLIBS += -lbsm
$(PAMPROG) := LDLIBS += -lpam
$(RPCSVCPROG) := LDLIBS += -lrpcsvc
$(CMDPROG) := LDLIBS += -lcmd
$(K5PROGS) := LDFLAGS += $(ZLAZYLOAD) $(KRUNPATH) \
-L$(ROOT)$(KLIBDIR_DO) -L$(ROOT)$(KLIBDIR_GL)
$(K5PROGS) := K5LIBS= -lmech_krb5
$(K5PROGS) := CPPFLAGS += -I$(SRC)/head \
-I$(SRC)/uts/common/ \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
-I$(SRC)/lib/gss_mechs/mech_krb5/include \
-I$(SRC)/lib/pam_modules/krb5
LDLIBS += $(K5LIBS)
$(IPSECUTILPROG) := LDLIBS += -lipsecutil
in.rarpd := LDLIBS += -linetutil
route := CPPFLAGS += -DNDEBUG
.KEEP_STATE:
.PARALLEL:
all: $(PROG) $(ROOTFS_PROG) $(SUBDIRS)
#
# message catalog
#
_msg: $(MSGSUBDIRS) $(POFILE)
syncutil: $(SYNCPROG)
$(POFILE): $(POFILES)
$(RM) $@
cat $(POFILES) > $@
$(COMMONOBJS): $(COMMONSRCS)
$(COMPILE.c) $(COMMONSRCS)
in.rlogind: $(K5RLOGINOBJS) $(COMMONOBJS)
$(LINK.c) $(K5RLOGINOBJS) $(COMMONOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
in.rshd: $(K5RSHDOBJS) $(COMMONOBJS)
$(LINK.c) $(K5RSHDOBJS) $(COMMONOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
in.tftpd: $(TFTPDOBJS)
$(LINK.c) $(TFTPDOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
tftpsubs.o: $(OTHERSRC)
$(COMPILE.c) $(OTHERSRC) -o $@
$(POST_PROCESS_O)
$(ROOTUSRSBINLINKS):
-$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
$(ROOTETCDEFAULT)/%: %.dfl
$(INS.rename)
install: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) .WAIT $(ROOTUSRSBINPROG) \
$(ROOTSBINPROG) $(ROOTUSRSBINLINKS) $(ROOTETCDEFAULTFILES) \
$(ROOTMANIFEST)
#
# The reason this rule checks for the existence of the
# Makefile is that some of the directories do not exist
# in our exportable source builds.
#
$(SUBDIRS): FRC
@if [ -f $@/Makefile ]; then \
cd $@; pwd; $(MAKE) $(TARGET); \
else \
true; \
fi
FRC:
check: $(CHKMANIFEST)
clean: $(SUBDIRS)
-$(RM) $(CLEANFILES)
clobber: $(SUBDIRS)
-$(RM) $(CLEANFILES) $(CLOBBERFILES)
lint: $(LINTSUBDIRS)
$(LINT.c) 6to4relay.c $(LDLIBS) -lsocket -lnsl
$(LINT.c) arp.c $(LDLIBS) -lsocket -lnsl
@# $(LINT.c) in.rexecd.c $(LDLIBS) -lbsm -lpam
$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \
-I$(SRC)/head -I$(SRC)/uts/common/ \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
-I$(SRC)/lib/gss_mechs/mech_krb5/include \
-I$(SRC)/lib/pam_modules/krb5 \
in.rlogind.c $(COMMONSRCS) $(LDLIBS) -lbsm -lpam -lsocket -lnsl
$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \
-I$(SRC)/head -I$(SRC)/uts/common/ \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
-I$(SRC)/lib/gss_mechs/mech_krb5/include \
-I$(SRC)/lib/pam_modules/krb5 \
in.rshd.c $(COMMONSRCS) $(LDLIBS) -lbsm -lpam -lsocket -lnsl
$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 \
-erroff=E_GLOBAL_COULD_BE_STATIC2 \
-I$(SRC)/head -I$(SRC)/uts/common/ \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
-I$(SRC)/lib/gss_mechs/mech_krb5/include \
-I$(SRC)/lib/pam_modules/krb5 \
in.telnetd.c $(LDLIBS) -lbsm -lpam -lsocket -lnsl
$(LINT.c) ipaddrsel.c $(LDLIBS) -lsocket -lnsl
$(LINT.c) ipsecalgs.c $(LDLIBS) -lsocket -lnsl -lipsecutil
$(LINT.c) ipsecconf.c $(LDLIBS) -lsocket -lnsl -lipsecutil
$(LINT.c) ipseckey.c $(LDLIBS) -lsocket -lnsl -lipsecutil
$(LINT.c) ikeadm.c $(LDLIBS) -lnsl -lipsecutil
$(LINT.c) route.c $(LDLIBS) -lsocket -lnsl
$(LINT.c) routeadm.c $(LDLIBS) -lsocket
$(LINT.c) syncinit.c $(LDLIBS) -ldlpi
$(LINT.c) syncloop.c $(LDLIBS) -ldlpi
$(LINT.c) syncstat.c $(LDLIBS) -ldlpi
$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 in.rarpd.c $(LDLIBS) \
-lsocket -lnsl
$(LINT.c) in.tftpd.c ../usr.bin/tftp/tftpsubs.c $(LDLIBS) \
-lsocket -lnsl
# EXPORT DELETE START
EXPORT_SRC:
$(RM) Makefile+
sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
< Makefile > Makefile+
$(RM) Makefile
$(MV) Makefile+ Makefile
$(CHMOD) 444 Makefile
# EXPORT DELETE END