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