17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
545916cd2Sjpk# Common Development and Distribution License (the "License").
645916cd2Sjpk# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
214e5b757fSkupfer
227c478bd9Sstevel@tonic-gate#
233e95bd4aSAnders Persson# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
24*7d10cd4dSGarrett D'Amore# Copyright 2022 Garrett D'Amore <garrett@damore.org>
2532e09e17SJohn Levon# Copyright 2019, Joyent, Inc.
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateSYNCPROG=	syncinit syncloop syncstat
297c478bd9Sstevel@tonic-gate
3090a455acSGarrett D'AmorePROG=		6to4relay arp if_mpadm \
31a192e900Samaguire		in.comsat in.fingerd in.rarpd in.rexecd in.rlogind \
3240537fccSgd		in.rshd in.rwhod in.telnetd in.tftpd ipaddrsel \
33bf5d9f18SAndy Fiddaman		ndd ndp $(SYNCPROG)
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gateMANIFEST=	rarp.xml telnet.xml comsat.xml finger.xml \
36*7d10cd4dSGarrett D'Amore		login.xml shell.xml rexec.xml
373e95bd4aSAnders PerssonSVCMETHOD=	svc-sockfilter
387c478bd9Sstevel@tonic-gate
39a192e900SamaguireROOTFS_PROG=	hostconfig route soconfig
40a192e900SamaguireSBINLINKS=	hostconfig route
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateRPCSVCPROG=	hostconfig
437c478bd9Sstevel@tonic-gateAUDITPROG=	in.rexecd in.rlogind in.rshd in.telnetd
447c478bd9Sstevel@tonic-gatePAMPROG=	in.rexecd in.rlogind in.rshd in.telnetd
4590a455acSGarrett D'AmoreSOCKETPROG=	6to4relay arp hostconfig if_mpadm in.comsat \
46a192e900Samaguire		in.fingerd in.rarpd in.rexecd in.rlogind in.rshd \
47e7df7762SCody Peter Mello		in.rwhod in.telnetd in.tftpd ipaddrsel ndp route
4890a455acSGarrett D'AmoreNSLPROG=	6to4relay arp hostconfig in.comsat in.rarpd \
49a192e900Samaguire		in.rexecd in.rlogind in.rshd in.rwhod in.telnetd \
50e7df7762SCody Peter Mello		in.tftpd ipaddrsel ndp route
517c478bd9Sstevel@tonic-gateCMDPROG=	in.telnetd
527c478bd9Sstevel@tonic-gateK5PROGS=	in.telnetd in.rlogind in.rshd
5345916cd2SjpkTSNETPROG=	route
546e91bba0SGirish MoodalbailDLADMPROG=	6to4relay
55a7872406SmeemDEFAULTFILES=	telnetd.dfl
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gatePROGSRCS=	$(PROG:%=%.c)
587c478bd9Sstevel@tonic-gateTFTPDOBJS=	in.tftpd.o tftpsubs.o
597c478bd9Sstevel@tonic-gateOTHERSRC=	../usr.bin/tftp/tftpsubs.c
607c478bd9Sstevel@tonic-gateK5RLOGINOBJS=	in.rlogind.o
617c478bd9Sstevel@tonic-gateK5RSHDOBJS=	in.rshd.o
6232885d59SgtbK5TELNETOBJS=	in.telnetd.o
637c478bd9Sstevel@tonic-gateSRCS=		$(PROGSRCS) $(OTHERSRC)
647c478bd9Sstevel@tonic-gate
65bf5d9f18SAndy FiddamanSUBDIRS=	ifconfig ilbadm in.rdisc in.routed \
666e91bba0SGirish Moodalbail		in.talkd inetadm inetconv ipadm ipmpstat ipqosconf ipsecutils \
67*7d10cd4dSGarrett D'Amore		nwamadm nwamcfg ping routeadm \
686ba597c5SAnurag S. Maskey		snoop sppptun traceroute wificonfig
697c478bd9Sstevel@tonic-gate
70bf5d9f18SAndy FiddamanMSGSUBDIRS=	ifconfig ilbadm in.routed in.talkd \
71dd49f125SAnders Persson		inetadm inetconv ipadm ipmpstat ipqosconf ipsecutils \
72*7d10cd4dSGarrett D'Amore		nwamadm nwamcfg routeadm sppptun snoop wificonfig
737c478bd9Sstevel@tonic-gate
7485f4cb87SRichard Lowe# This controls the degree of compiler warnings emitted, and is named for
7585f4cb87SRichard Lowe# 'lint' for historical reasons.  Eventually this hack should go away, and all
7685f4cb87SRichard Lowe# in PROG should be clean.
77e3320f40SmarkfenLINTCLEAN=	6to4relay arp in.rlogind in.rshd in.telnetd in.tftpd \
78e7df7762SCody Peter Mello		ipaddrsel ndp route \
794b908718Smeem		in.rarpd if_mpadm $(SYNCPROG)
807c478bd9Sstevel@tonic-gate
817c478bd9Sstevel@tonic-gateinclude ../../Makefile.cmd
827c478bd9Sstevel@tonic-gateROOTMANIFESTDIR=	$(ROOTSVCNETWORK)
837c478bd9Sstevel@tonic-gate$(ROOTMANIFEST)		:= FILEMODE= 444
847c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd-inet
857c478bd9Sstevel@tonic-gate
867c478bd9Sstevel@tonic-gateROOTSBINPROG = $(ROOTFS_PROG:%=$(ROOTSBIN)/%)
877c478bd9Sstevel@tonic-gateROOTUSRSBINLINKS = $(SBINLINKS:%=$(ROOTUSRSBIN)/%)
887c478bd9Sstevel@tonic-gate
8932885d59SgtbCOMMONOBJS=	addr_match.o kcmd.o store_forw_creds.o
907243fb49SjbeckCOMMONSRCS=	$(COMMONOBJS:%.o=$(CMDINETCOMMONDIR)/%.c)
917c478bd9Sstevel@tonic-gateSRCS+=		$(COMMONSRCS)
927c478bd9Sstevel@tonic-gate
937014882cSRichard LoweCERRWARN += -_gcc=-Wno-implicit-function-declaration
94d3b5f563SJohn LevonCERRWARN += $(CNOWARN_UNINIT)
957014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable
967014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-function
977014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses
987014882cSRichard LoweCERRWARN += -_gcc=-Wno-char-subscripts
997014882cSRichard LoweCERRWARN += -_gcc=-Wno-extra
1007014882cSRichard LoweCERRWARN += -_gcc=-Wno-address
1017014882cSRichard Lowe
1025661bb76SJohn Levon# "missing type for func"
1035661bb76SJohn LevonSMATCH=off
1045661bb76SJohn Levon
1057c478bd9Sstevel@tonic-gate#
1067c478bd9Sstevel@tonic-gate# Message catalog
1077c478bd9Sstevel@tonic-gate#
1083e95bd4aSAnders PerssonPOFILES=	6to4relay.po if_mpadm.po in.comsat.po ipaddrsel.po route.po \
1093e95bd4aSAnders Persson		soconfig.po
1107c478bd9Sstevel@tonic-gatePOFILE=		usr.sbin.po
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gateall:=		TARGET= all
1137c478bd9Sstevel@tonic-gateinstall:=	TARGET= install
1147c478bd9Sstevel@tonic-gateclean:=		TARGET= clean
1157c478bd9Sstevel@tonic-gateclobber:=	TARGET= clobber
1167c478bd9Sstevel@tonic-gate_msg:=		TARGET= _msg
1177c478bd9Sstevel@tonic-gate
118c2785286SgtbCLOBBERFILES +=	$(ROOTFS_PROG) $(PROG)
119b6805bf7SGordon RossCLEANFILES += $(COMMONOBJS) $(K5RLOGINOBJS) $(K5RSHDOBJS) $(TFTPDOBJS) \
120b6805bf7SGordon Ross		$(K5TELNETOBJS)
1217c478bd9Sstevel@tonic-gate
122a192e900SamaguireCPPFLAGS +=	-DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I
1237c478bd9Sstevel@tonic-gate
1247c478bd9Sstevel@tonic-gateinclude $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
1257c478bd9Sstevel@tonic-gateK5LIBS=
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gate# Eventually just plain CFLAGS should be += -v, but not until all in
1287c478bd9Sstevel@tonic-gate# PROGS are lint clean.
1297c478bd9Sstevel@tonic-gate$(LINTCLEAN)		:=	CFLAGS += $(CCVERBOSE)
1307c478bd9Sstevel@tonic-gate
1317c478bd9Sstevel@tonic-gate$(SYNCPROG)		:=	LDLIBS += -ldlpi
1327c478bd9Sstevel@tonic-gate$(SOCKETPROG)		:=	LDLIBS += -lsocket
1337c478bd9Sstevel@tonic-gate$(NSLPROG)		:=	LDLIBS += -lnsl
1347c478bd9Sstevel@tonic-gate$(AUDITPROG)		:=	LDLIBS += -lbsm
1357c478bd9Sstevel@tonic-gate$(PAMPROG)		:=	LDLIBS += -lpam
1367c478bd9Sstevel@tonic-gate$(RPCSVCPROG)		:=	LDLIBS += -lrpcsvc
13767e3a03eSrie$(K5PROGS)		:=	LDFLAGS += $(KRUNPATH) \
1387c478bd9Sstevel@tonic-gate				-L$(ROOT)$(KLIBDIR_DO) -L$(ROOT)$(KLIBDIR_GL)
1397c478bd9Sstevel@tonic-gate$(K5PROGS)		:=	K5LIBS=  -lmech_krb5
1407c478bd9Sstevel@tonic-gate$(K5PROGS)		:=	CPPFLAGS += -I$(SRC)/head \
1417c478bd9Sstevel@tonic-gate				-I$(SRC)/uts/common/ \
1427c478bd9Sstevel@tonic-gate				-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
1437c478bd9Sstevel@tonic-gate				-I$(SRC)/lib/gss_mechs/mech_krb5/include \
1447c478bd9Sstevel@tonic-gate				-I$(SRC)/lib/pam_modules/krb5
1457c478bd9Sstevel@tonic-gateLDLIBS +=	$(K5LIBS)
14667e3a03eSrie$(TSNETPROG)		:=	LDLIBS += -ltsnet
1472b24ab6bSSebastien Roy$(DLADMPROG)		:=	LDLIBS += -ldladm
1487c478bd9Sstevel@tonic-gate
149948f2876Sssin.rarpd		:=	LDLIBS += -linetutil -ldlpi
150e11c3f44Smeemif_mpadm		:=	LDLIBS += -linetutil -lipmp
151e11c3f44Smeemif_mpadm.po		:=	XGETFLAGS += -a
1527c478bd9Sstevel@tonic-gateroute			:=	CPPFLAGS += -DNDEBUG
1536e91bba0SGirish Moodalbailndd			:=	LDLIBS += -ldladm -lipadm
15432e09e17SJohn Levon$(RELEASE_BUILD)ndd	:=	CERRWARN += -_gcc=-Wno-unused
15585f4cb87SRichard Lowein.comsat		:=	LDFLAGS += $(MAPFILE.NGB:%=-Wl,-M%)
1567c478bd9Sstevel@tonic-gate
1577c478bd9Sstevel@tonic-gate.KEEP_STATE:
1587c478bd9Sstevel@tonic-gate
1597c478bd9Sstevel@tonic-gate.PARALLEL:
1607c478bd9Sstevel@tonic-gate
1614e5b757fSkupferall: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) THIRDPARTYLICENSE.arp
1627c478bd9Sstevel@tonic-gate
1637c478bd9Sstevel@tonic-gate#
1647c478bd9Sstevel@tonic-gate# message catalog
1657c478bd9Sstevel@tonic-gate#
1667c478bd9Sstevel@tonic-gate_msg: $(MSGSUBDIRS) $(POFILE)
1677c478bd9Sstevel@tonic-gate
1687c478bd9Sstevel@tonic-gatesyncutil: $(SYNCPROG)
1697c478bd9Sstevel@tonic-gate
1707c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES)
1717c478bd9Sstevel@tonic-gate	$(RM) $@
1727c478bd9Sstevel@tonic-gate	cat $(POFILES) > $@
1737c478bd9Sstevel@tonic-gate
1747243fb49Sjbeck%.o: $(CMDINETCOMMONDIR)/%.c
1757243fb49Sjbeck	$(COMPILE.c) -o $@ $<
1767c478bd9Sstevel@tonic-gate
177c2785286Sgtbin.telnetd: $(K5TELNETOBJS)
178c2785286Sgtb	$(LINK.c) $(K5TELNETOBJS) -o $@ $(LDLIBS)
17932885d59Sgtb	$(POST_PROCESS)
18032885d59Sgtb
181c2785286Sgtbin.rlogind: $(K5RLOGINOBJS) $(COMMONOBJS)
182c2785286Sgtb	$(LINK.c) $(K5RLOGINOBJS) $(COMMONOBJS) -o $@ $(LDLIBS)
1837c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1847c478bd9Sstevel@tonic-gate
185c2785286Sgtbin.rshd: $(K5RSHDOBJS) $(COMMONOBJS)
186c2785286Sgtb	$(LINK.c) $(K5RSHDOBJS) $(COMMONOBJS) -o $@ $(LDLIBS)
1877c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1887c478bd9Sstevel@tonic-gate
1897c478bd9Sstevel@tonic-gatein.tftpd: $(TFTPDOBJS)
1907c478bd9Sstevel@tonic-gate	$(LINK.c) $(TFTPDOBJS) -o $@ $(LDLIBS)
1917c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1927c478bd9Sstevel@tonic-gate
1937c478bd9Sstevel@tonic-gatetftpsubs.o: $(OTHERSRC)
1947c478bd9Sstevel@tonic-gate	$(COMPILE.c) $(OTHERSRC) -o $@
1957c478bd9Sstevel@tonic-gate	$(POST_PROCESS_O)
1967c478bd9Sstevel@tonic-gate
1977c478bd9Sstevel@tonic-gate$(ROOTUSRSBINLINKS):
1987c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
1997c478bd9Sstevel@tonic-gate
2007c478bd9Sstevel@tonic-gateinstall: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) .WAIT $(ROOTUSRSBINPROG) \
2017c478bd9Sstevel@tonic-gate	$(ROOTSBINPROG) $(ROOTUSRSBINLINKS) $(ROOTETCDEFAULTFILES) \
2023e95bd4aSAnders Persson	$(ROOTMANIFEST) $(ROOTSVCMETHOD) THIRDPARTYLICENSE.arp
2034e5b757fSkupfer
2044e5b757fSkupferTHIRDPARTYLICENSE.arp: arp.c
2054e5b757fSkupfer	$(SED) -n '/University of California/,/SUCH DAMAGE/p' arp.c > $@
2064e5b757fSkupfer
2074e5b757fSkupferCLOBBERFILES += THIRDPARTYLICENSE.arp
2087c478bd9Sstevel@tonic-gate
2097c478bd9Sstevel@tonic-gate$(SUBDIRS): FRC
2103aa6c130SRichard Lowe	cd $@; pwd; $(MAKE) $(TARGET)
2117c478bd9Sstevel@tonic-gate
2127c478bd9Sstevel@tonic-gateFRC:
2137c478bd9Sstevel@tonic-gate
2147c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
2157c478bd9Sstevel@tonic-gate
216b6805bf7SGordon Rossclean: $(SUBDIRS) clean_local
217b6805bf7SGordon Rossclean_local:
218b6805bf7SGordon Ross	$(RM) $(CLEANFILES)
2197c478bd9Sstevel@tonic-gate
220b6805bf7SGordon Rossclobber: $(SUBDIRS) clobber_local
221b6805bf7SGordon Rossclobber_local: clean_local
222b6805bf7SGordon Ross	$(RM) $(CLOBBERFILES)
223