Makefile revision 5ffb0c9b03b5149ff4f5821a62be4a52408ada2a
0N/A#
2362N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License (the "License").
0N/A# You may not use this file except in compliance with the License.
2362N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2362N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
0N/A# information: Portions Copyright [yyyy] [name of copyright owner]
0N/A#
0N/A# CDDL HEADER END
0N/A#
2362N/A#
2362N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
2362N/A# Use is subject to license terms.
0N/A#
0N/A# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
0N/A# Copyright 2016 Toomas Soome <tsoome@me.com>
0N/A#
0N/A
0N/APROG= finger rdate ruptime rwho whois
0N/ASUIDPROG= rcp rlogin rsh
0N/AALL= $(PROG) $(SUIDPROG)
0N/ASRCS= $(ALL:%=%.c)
0N/AKCMDPROGS= rcp rlogin rsh
0N/A
0N/ASUBDIRS= chat dns-sd ftp nc nca netstat \
0N/A pppd pppdump pppstats rdist talk telnet tftp
0N/ASUBDIR1= talk
0N/AMSGSUBDIRS= nca talk
0N/A
0N/A# As programs get lint-clean, add them here. Eventually.
0N/A# This hack should go away, and all in PROG should be lint-clean.
0N/ALINTCLEAN= rlogin.c rsh.c rcp.c rdate.c rwho.c whois.c
0N/A
0N/A# Likewise, as subdirs get lint-clean, add them here. Once
0N/A# they're all clean, replace the dependency of the lint target
0N/A# with SUBDIRS. Also (sigh) deal with the commented-out build lines
0N/A# for the lint rule.
0N/ALINTSUBDIRS= nca netstat pppd pppstats tftp
0N/A
0N/Ainclude ../../Makefile.cmd
0N/Ainclude ../Makefile.cmd-inet
0N/A
0N/ACOMMONOBJS= kcmd.o
0N/ACOMMONPOFILES= $(COMMONOBJS:.o=.po)
0N/ACOMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:.o=.c)
0N/A
0N/APOFILES= rlogin.po rsh.po rcp.po $(COMMONPOFILES)
0N/APOFILE= usr.bin.po
0N/A
0N/ACLOBBERFILES += $(ALL)
0N/ACLEANFILES += kcmd.o rcp.o rlogin.o rsh.o
0N/A
0N/Aall:= TARGET= all
0N/Ainstall:= TARGET= install
0N/Aclean:= TARGET= clean
0N/Aclobber:= TARGET= clobber
0N/Alint:= TARGET= lint
0N/A_msg:= TARGET= _msg
0N/A
0N/AROOTSUIDPROG= $(SUIDPROG:%=$(ROOTBIN)/%)
0N/A$(ROOTSUIDPROG) := FILEMODE= 04555
0N/A
0N/ACPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP -I$(CMDINETCOMMONDIR)
0N/ACERRWARN += -_gcc=-Wno-parentheses
0N/ACERRWARN += -_gcc=-Wno-uninitialized
0N/ACERRWARN += -_gcc=-Wno-unused-function
0N/A
0N/A# Eventually just plain CFLAGS should be += -v, but not until all in
0N/A# PROGS are lint clean.
0N/A$(LINTCLEAN) := CFLAGS += $(CCVERBOSE)
0N/A
0N/Afinger := CFLAGS += $(CCVERBOSE)
0N/A# Enable large file support for reading the lastlog file.
0N/Afinger := CPPFLAGS += -D_FILE_OFFSET_BITS=64
0N/A
0N/Afinger := LDLIBS += -lnsl -lcurses -lsocket
0N/Arcp lint-rcp := LDLIBS += -lsocket -lsec -lsendfile
0N/Ardate lint-rdate:= LDLIBS += -lsocket
0N/Arlogin lint-rlogin := LDLIBS += -lnsl -lsocket
0N/Arsh lint-rsh := LDLIBS += -lsocket
0N/Awhois lint-whois := LDLIBS += -lsocket
0N/A
0N/Ainclude $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
0N/A$(KCMDPROGS) := LDLIBS += -lnsl -lmech_krb5
0N/A$(KCMDPROGS) := LDFLAGS += $(ZIGNORE) $(KRUNPATH) \
0N/A -L$(ROOT)$(KLIBDIR_DO) \
0N/A -L$(ROOT)$(KLIBDIR_GL)
0N/AKCMDLINTS= $(KCMDPROGS:%=lint-%)
0N/A
0N/A$(COMMONPOFILES) \
0N/Arlogin.po rcp.po rsh.po \
0N/A$(KCMDPROGS) \
0N/A$(KCMDLINTS) := CPPFLAGS += -DKERBEROS \
0N/A -I$(CMDINETCOMMONDIR) \
0N/A -I$(SRC)/lib/gss_mechs/mech_krb5 \
0N/A -I$(SRC)/uts/common/gssapi/mechs/krb5/include \
0N/A -I$(SRC)/lib/gss_mechs/mech_krb5/include \
0N/A -I$(SRC)/lib/gss_mechs/mech_krb5/include/krb5
0N/A
0N/A# "-erroff=E_NAME_USED_NOT_DEF2" and "-erroff=E_NAME_DEF_NOT_USED2"
0N/A# are required because lint problems in the Kerberos 5 framework.
0N/A$(KCMDLINTS) := LINTFLAGS += -lnsl \
0N/A -erroff=E_NAME_USED_NOT_DEF2 \
0N/A -erroff=E_NAME_DEF_NOT_USED2
0N/A
0N/A# Extra source files to lint with
0N/ALINTXTRA=
0N/A$(KCMDLINTS) := LINTXTRA += $(COMMONSRCS)
0N/A
0N/AROOTSUNWRCP= $(ROOT)/usr/lib/sunw,rcp
0N/AROOTRSHSYMLINK= $(ROOT)/usr/ucb/rsh
0N/AROOTREMSHSYMLINK=$(ROOT)/usr/bin/remsh
0N/A
0N/A.KEEP_STATE:
0N/A
0N/Aall: $(ALL) $(SUBDIRS)
0N/A
0N/Ainstall: all .WAIT $(ROOTPROG) $(ROOTSUIDPROG) \
0N/A $(SUBDIRS) $(ROOTSUNWRCP) $(ROOTRSHSYMLINK) $(ROOTREMSHSYMLINK)
0N/A
0N/A# Messaging - copy $POFILES to $POFILE to work with the parent directory
0N/A# Makefile's '_msg' target.
0N/A#
0N/A_msg: $(MSGSUBDIRS) $(POFILES)
0N/A $(RM) $(POFILE)
0N/A $(CAT) $(POFILES) > $(POFILE)
0N/A
0N/A$(COMMONPOFILES): $(COMMONSRCS)
0N/A $(COMPILE.cpp) $(COMMONSRCS) > $(@:.po=.c).i
0N/A $(XGETTEXT) $(XGETFLAGS) $(@:.po=.c).i
0N/A $(RM) $@
0N/A sed "/^domain/d" < messages.po > $@
0N/A $(RM) messages.po $(@:.po=.c).i
$(COMMONOBJS): $(COMMONSRCS)
$(COMPILE.c) $(COMMONSRCS)
rlogin: rlogin.o $(COMMONOBJS)
$(LINK.c) $@.o $(COMMONOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
rcp: rcp.o $(COMMONOBJS)
$(LINK.c) $@.o $(COMMONOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
rsh: rsh.o $(COMMONOBJS)
$(LINK.c) $@.o $(COMMONOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
$(ROOTSUNWRCP):
$(RM) $@; $(SYMLINK) ../bin/rcp $@
$(ROOTRSHSYMLINK):
$(RM) $@; $(SYMLINK) ../bin/rsh $@
$(ROOTREMSHSYMLINK):
$(RM) $@; $(SYMLINK) rsh $@
$(SUBDIRS): FRC
@cd $@; pwd; $(MAKE) $(MFLAGS) $(TARGET)
FRC:
clean: $(SUBDIRS) clean_local
clean_local:
$(RM) $(CLEANFILES)
clobber: $(SUBDIRS) clobber_local
clobber_local: clean_local
$(RM) $(CLOBBERFILES)
LINTLOCALS= $(LINTCLEAN:%.c=lint-%)
lint: $(LINTSUBDIRS) $(LINTLOCALS)
$(LINTLOCALS):
$(LINT.c) $(@:lint-%=%.c) $(LINTXTRA) $(LDLIBS)