4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 # Copyright 2016 Toomas Soome <tsoome@me.com>
29 PROG
= finger rdate ruptime rwho whois
30 SUIDPROG
= rcp rlogin rsh
31 ALL
= $(PROG
) $(SUIDPROG
)
33 KCMDPROGS
= rcp rlogin rsh
35 SUBDIRS
= chat dns-sd ftp nc nca netstat \
36 pppd pppdump pppstats rdist talk telnet tftp
40 # As programs get lint-clean, add them here. Eventually.
41 # This hack should go away, and all in PROG should be lint-clean.
42 LINTCLEAN
= rlogin.c rsh.c rcp.c rdate.c rwho.c whois.c
44 # Likewise, as subdirs get lint-clean, add them here. Once
45 # they're all clean, replace the dependency of the lint target
46 # with SUBDIRS. Also (sigh) deal with the commented-out build lines
48 LINTSUBDIRS
= nca netstat pppd pppstats tftp
50 include ..
/..
/Makefile.cmd
51 include ..
/Makefile.cmd-inet
54 COMMONPOFILES
= $(COMMONOBJS
:.o
=.po
)
55 COMMONSRCS
= $(CMDINETCOMMONDIR
)/$(COMMONOBJS
:.o
=.c
)
57 POFILES
= rlogin.po rsh.po rcp.po
$(COMMONPOFILES
)
60 CLOBBERFILES
+= $(ALL
)
61 CLEANFILES
+= kcmd.o rcp.o rlogin.o rsh.o
64 install:= TARGET
= install
66 clobber:= TARGET
= clobber
70 ROOTSUIDPROG
= $(SUIDPROG
:%=$(ROOTBIN
)/%)
71 $(ROOTSUIDPROG
) := FILEMODE
= 04555
73 CPPFLAGS
+= -DSYSV
-DSTRNET
-DBSD_COMP
-I
$(CMDINETCOMMONDIR
)
74 CERRWARN
+= -_gcc
=-Wno-parentheses
75 CERRWARN
+= -_gcc
=-Wno-uninitialized
76 CERRWARN
+= -_gcc
=-Wno-unused-function
78 # Eventually just plain CFLAGS should be += -v, but not until all in
79 # PROGS are lint clean.
80 $(LINTCLEAN
) := CFLAGS
+= $(CCVERBOSE
)
82 finger
:= CFLAGS
+= $(CCVERBOSE
)
83 # Enable large file support for reading the lastlog file.
84 finger
:= CPPFLAGS
+= -D_FILE_OFFSET_BITS
=64
86 finger
:= LDLIBS
+= -lnsl
-lcurses
-lsocket
87 rcp lint-rcp
:= LDLIBS
+= -lsocket
-lsec
-lsendfile
88 rdate lint-rdate
:= LDLIBS
+= -lsocket
89 rlogin lint-rlogin
:= LDLIBS
+= -lnsl
-lsocket
90 rsh lint-rsh
:= LDLIBS
+= -lsocket
91 whois lint-whois
:= LDLIBS
+= -lsocket
93 include $(SRC
)/lib
/gss_mechs
/mech_krb5
/Makefile.mech_krb5
94 $(KCMDPROGS
) := LDLIBS
+= -lnsl
-lmech_krb5
95 $(KCMDPROGS
) := LDFLAGS
+= $(ZIGNORE
) $(KRUNPATH
) \
96 -L
$(ROOT
)$(KLIBDIR_DO
) \
97 -L
$(ROOT
)$(KLIBDIR_GL
)
98 KCMDLINTS
= $(KCMDPROGS
:%=lint-
%)
101 rlogin.po rcp.po rsh.po \
103 $(KCMDLINTS
) := CPPFLAGS
+= -DKERBEROS \
104 -I
$(CMDINETCOMMONDIR
) \
105 -I
$(SRC
)/lib
/gss_mechs
/mech_krb5 \
106 -I
$(SRC
)/uts
/common
/gssapi
/mechs
/krb5
/include \
107 -I
$(SRC
)/lib
/gss_mechs
/mech_krb5
/include \
108 -I
$(SRC
)/lib
/gss_mechs
/mech_krb5
/include/krb5
110 # "-erroff=E_NAME_USED_NOT_DEF2" and "-erroff=E_NAME_DEF_NOT_USED2"
111 # are required because lint problems in the Kerberos 5 framework.
112 $(KCMDLINTS
) := LINTFLAGS
+= -lnsl \
113 -erroff
=E_NAME_USED_NOT_DEF2 \
114 -erroff
=E_NAME_DEF_NOT_USED2
116 # Extra source files to lint with
118 $(KCMDLINTS
) := LINTXTRA
+= $(COMMONSRCS
)
120 ROOTSUNWRCP
= $(ROOT
)/usr
/lib
/sunw
,rcp
121 ROOTRSHSYMLINK
= $(ROOT
)/usr
/ucb
/rsh
122 ROOTREMSHSYMLINK
=$(ROOT
)/usr
/bin
/remsh
126 all: $(ALL
) $(SUBDIRS
)
128 install: all .WAIT
$(ROOTPROG
) $(ROOTSUIDPROG
) \
129 $(SUBDIRS
) $(ROOTSUNWRCP
) $(ROOTRSHSYMLINK
) $(ROOTREMSHSYMLINK
)
131 # Messaging - copy $POFILES to $POFILE to work with the parent directory
132 # Makefile's '_msg' target.
134 _msg
: $(MSGSUBDIRS
) $(POFILES
)
136 $(CAT
) $(POFILES
) > $(POFILE
)
138 $(COMMONPOFILES
): $(COMMONSRCS
)
139 $(COMPILE.
cpp) $(COMMONSRCS
) > $(@
:.po
=.c
).i
140 $(XGETTEXT
) $(XGETFLAGS
) $(@
:.po
=.c
).i
142 sed
"/^domain/d" < messages.po
> $@
143 $(RM
) messages.po
$(@
:.po
=.c
).i
145 $(COMMONOBJS
): $(COMMONSRCS
)
146 $(COMPILE.c
) $(COMMONSRCS
)
148 rlogin
: rlogin.o
$(COMMONOBJS
)
149 $(LINK.c
) $@.o
$(COMMONOBJS
) -o
$@
$(LDLIBS
)
152 rcp
: rcp.o
$(COMMONOBJS
)
153 $(LINK.c
) $@.o
$(COMMONOBJS
) -o
$@
$(LDLIBS
)
156 rsh
: rsh.o
$(COMMONOBJS
)
157 $(LINK.c
) $@.o
$(COMMONOBJS
) -o
$@
$(LDLIBS
)
161 $(RM
) $@
; $(SYMLINK
) ..
/bin
/rcp
$@
164 $(RM
) $@
; $(SYMLINK
) ..
/bin
/rsh
$@
167 $(RM
) $@
; $(SYMLINK
) rsh
$@
170 @cd
$@
; pwd
; $(MAKE
) $(MFLAGS
) $(TARGET
)
174 clean: $(SUBDIRS
) clean_local
178 clobber: $(SUBDIRS
) clobber_local
179 clobber_local
: clean_local
180 $(RM
) $(CLOBBERFILES
)
182 LINTLOCALS
= $(LINTCLEAN
:%.c
=lint-
%)
184 lint
: $(LINTSUBDIRS
) $(LINTLOCALS
)
187 $(LINT.c
) $(@
:lint-
%=%.c
) $(LINTXTRA
) $(LDLIBS
)