xref: /onnv-gate/usr/src/cmd/cmd-inet/usr.sbin/Makefile (revision 12644:4f9a0cd40c5f)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
51676Sjpk# Common Development and Distribution License (the "License").
61676Sjpk# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
214162Skupfer
220Sstevel@tonic-gate#
2312643SAnders.Persson@Sun.COM# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
240Sstevel@tonic-gate#
250Sstevel@tonic-gate
260Sstevel@tonic-gateSYNCPROG=	syncinit syncloop syncstat
270Sstevel@tonic-gateDHCPPROG=	dhcpconfig dhtadm pntadm
280Sstevel@tonic-gate
290Sstevel@tonic-gate# EXPORT DELETE START
300Sstevel@tonic-gateXMODPROG=	wanbootutil
310Sstevel@tonic-gate# EXPORT DELETE END
320Sstevel@tonic-gate
334235SmarkfenPROG=		6to4relay arp gettable if_mpadm \
343048Samaguire		in.comsat in.fingerd in.rarpd in.rexecd in.rlogind \
354097Sgd78059		in.rshd in.rwhod in.telnetd in.tftpd ipaddrsel \
364235Smarkfen		ndd $(SYNCPROG) $(DHCPPROG) $(XMODPROG)
370Sstevel@tonic-gate
380Sstevel@tonic-gateMANIFEST=	rarp.xml telnet.xml comsat.xml finger.xml \
39*12644SAnders.Persson@Sun.COM		login.xml shell.xml rexec.xml socket-filter-kssl.xml
4012643SAnders.Persson@Sun.COMSVCMETHOD=	svc-sockfilter
410Sstevel@tonic-gate
423048SamaguireROOTFS_PROG=	hostconfig route soconfig
433048SamaguireSBINLINKS=	hostconfig route
440Sstevel@tonic-gate
450Sstevel@tonic-gateRPCSVCPROG=	hostconfig
460Sstevel@tonic-gateAUDITPROG=	in.rexecd in.rlogind in.rshd in.telnetd
470Sstevel@tonic-gatePAMPROG=	in.rexecd in.rlogind in.rshd in.telnetd
480Sstevel@tonic-gateSOCKETPROG=	6to4relay arp gettable hostconfig if_mpadm in.comsat \
493048Samaguire		in.fingerd in.rarpd in.rexecd in.rlogind in.rshd \
504235Smarkfen		in.rwhod in.telnetd in.tftpd ipaddrsel route
514235SmarkfenNSLPROG=	6to4relay arp gettable hostconfig in.comsat in.rarpd \
523048Samaguire		in.rexecd in.rlogind in.rshd in.rwhod in.telnetd \
534235Smarkfen		in.tftpd ipaddrsel route
540Sstevel@tonic-gateCMDPROG=	in.telnetd
550Sstevel@tonic-gateK5PROGS=	in.telnetd in.rlogind in.rshd
561676SjpkTSNETPROG=	route
5712016SGirish.Moodalbail@Sun.COMDLADMPROG=	6to4relay
5889SmeemDEFAULTFILES=	telnetd.dfl
590Sstevel@tonic-gate
600Sstevel@tonic-gatePROGSRCS=	$(PROG:%=%.c)
610Sstevel@tonic-gateTFTPDOBJS=	in.tftpd.o tftpsubs.o
620Sstevel@tonic-gateOTHERSRC=	../usr.bin/tftp/tftpsubs.c
630Sstevel@tonic-gateK5RLOGINOBJS=	in.rlogind.o
640Sstevel@tonic-gateK5RSHDOBJS=	in.rshd.o
656536SgtbK5TELNETOBJS=	in.telnetd.o
660Sstevel@tonic-gateSRCS=		$(PROGSRCS) $(OTHERSRC)
670Sstevel@tonic-gate
6810946SSangeeta.Misra@Sun.COMSUBDIRS=	bootconfchk htable ifconfig ilbadm in.ftpd in.rdisc in.routed \
6912016SGirish.Moodalbail@Sun.COM		in.talkd inetadm inetconv ipadm ipmpstat ipqosconf ipsecutils \
7011767SAnurag.Maskey@Sun.COM		kssl/kssladm kssl/ksslcfg nwamadm nwamcfg ping routeadm \
7111767SAnurag.Maskey@Sun.COM		snoop sppptun traceroute wificonfig
720Sstevel@tonic-gate
7310946SSangeeta.Misra@Sun.COMMSGSUBDIRS=	bootconfchk htable ifconfig ilbadm in.ftpd in.routed in.talkd \
74*12644SAnders.Persson@Sun.COM		inetadm inetconv ipadm ipmpstat ipqosconf ipsecutils \
75*12644SAnders.Persson@Sun.COM		kssl/ksslcfg nwamadm nwamcfg routeadm sppptun snoop wificonfig
760Sstevel@tonic-gate
770Sstevel@tonic-gate# As programs get lint-clean, add them here and to the 'lint' target.
780Sstevel@tonic-gate# Eventually this hack should go away, and all in PROG should be
790Sstevel@tonic-gate# lint-clean.
804235SmarkfenLINTCLEAN=	6to4relay arp in.rlogind in.rshd in.telnetd in.tftpd \
814235Smarkfen		ipaddrsel route \
82515Smeem		in.rarpd if_mpadm $(SYNCPROG)
830Sstevel@tonic-gate# Likewise, as subdirs get lint-clean, add them here.  Once
840Sstevel@tonic-gate# they're all clean, replace the dependency of the lint target
850Sstevel@tonic-gate# with SUBDIRS.  Also (sigh) deal with the commented-out build lines
860Sstevel@tonic-gate# for the lint rule.
8710946SSangeeta.Misra@Sun.COMLINTSUBDIRS=	bootconfchk ilbadm in.rdisc in.routed in.talkd inetadm \
88*12644SAnders.Persson@Sun.COM		inetconv ipmpstat ipqosconf ipsecutils kssl/kssladm \
89*12644SAnders.Persson@Sun.COM		kssl/ksslcfg nwamadm nwamcfg ping routeadm sppptun traceroute \
90*12644SAnders.Persson@Sun.COM		wificonfig
910Sstevel@tonic-gate# And as programs are verified not to attempt to write into constants,
920Sstevel@tonic-gate# -xstrconst should be used to ensure they stay that way.
934235SmarkfenCONSTCLEAN=
940Sstevel@tonic-gate
950Sstevel@tonic-gateinclude ../../Makefile.cmd
960Sstevel@tonic-gateROOTMANIFESTDIR=	$(ROOTSVCNETWORK)
970Sstevel@tonic-gate$(ROOTMANIFEST)		:= FILEMODE= 444
980Sstevel@tonic-gateinclude ../Makefile.cmd-inet
990Sstevel@tonic-gate
1000Sstevel@tonic-gateROOTSBINPROG = $(ROOTFS_PROG:%=$(ROOTSBIN)/%)
1010Sstevel@tonic-gateROOTUSRSBINLINKS = $(SBINLINKS:%=$(ROOTUSRSBIN)/%)
1020Sstevel@tonic-gate
1036536SgtbCOMMONOBJS=	addr_match.o kcmd.o store_forw_creds.o
1043011SjbeckCOMMONSRCS=	$(COMMONOBJS:%.o=$(CMDINETCOMMONDIR)/%.c)
1050Sstevel@tonic-gateSRCS+=		$(COMMONSRCS)
1060Sstevel@tonic-gate
1070Sstevel@tonic-gate#
1080Sstevel@tonic-gate# Message catalog
1090Sstevel@tonic-gate#
11012643SAnders.Persson@Sun.COMPOFILES=	6to4relay.po if_mpadm.po in.comsat.po ipaddrsel.po route.po \
11112643SAnders.Persson@Sun.COM		soconfig.po
1120Sstevel@tonic-gatePOFILE=		usr.sbin.po
1130Sstevel@tonic-gate
1140Sstevel@tonic-gateall:=		TARGET= all
1150Sstevel@tonic-gateinstall:=	TARGET= install
1160Sstevel@tonic-gateclean:=		TARGET= clean
1170Sstevel@tonic-gateclobber:=	TARGET= clobber
1180Sstevel@tonic-gatelint:=		TARGET= lint
1190Sstevel@tonic-gate_msg:=		TARGET= _msg
1200Sstevel@tonic-gate
1216727SgtbCLOBBERFILES +=	$(ROOTFS_PROG) $(PROG)
1220Sstevel@tonic-gateCLEANFILES += $(COMMONOBJS) $(K5RLOGINOBJS) $(K5RSHDOBJS) $(TFTPDOBJS)
1230Sstevel@tonic-gate
1243048SamaguireCPPFLAGS +=	-DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I
1250Sstevel@tonic-gate
1260Sstevel@tonic-gateinclude $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
1270Sstevel@tonic-gateK5LIBS=
1280Sstevel@tonic-gate
1290Sstevel@tonic-gate# Eventually just plain CFLAGS should be += -v, but not until all in
1300Sstevel@tonic-gate# PROGS are lint clean.
1310Sstevel@tonic-gate$(LINTCLEAN)		:=	CFLAGS += $(CCVERBOSE)
1320Sstevel@tonic-gate$(CONSTCLEAN)		:=	CFLAGS += $(XSTRCONST)
1330Sstevel@tonic-gate
1340Sstevel@tonic-gate$(SYNCPROG)		:=	LDLIBS += -ldlpi
1350Sstevel@tonic-gate$(SOCKETPROG)		:=	LDLIBS += -lsocket
1360Sstevel@tonic-gate$(NSLPROG)		:=	LDLIBS += -lnsl
1370Sstevel@tonic-gate$(AUDITPROG)		:=	LDLIBS += -lbsm
1380Sstevel@tonic-gate$(PAMPROG)		:=	LDLIBS += -lpam
1390Sstevel@tonic-gate$(RPCSVCPROG)		:=	LDLIBS += -lrpcsvc
1406543Srie$(K5PROGS)		:=	LDFLAGS += $(KRUNPATH) \
1410Sstevel@tonic-gate				-L$(ROOT)$(KLIBDIR_DO) -L$(ROOT)$(KLIBDIR_GL)
1420Sstevel@tonic-gate$(K5PROGS)		:=	K5LIBS=  -lmech_krb5
1430Sstevel@tonic-gate$(K5PROGS)		:=	CPPFLAGS += -I$(SRC)/head \
1440Sstevel@tonic-gate				-I$(SRC)/uts/common/ \
1450Sstevel@tonic-gate				-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
1460Sstevel@tonic-gate				-I$(SRC)/lib/gss_mechs/mech_krb5/include \
1470Sstevel@tonic-gate				-I$(SRC)/lib/pam_modules/krb5
1480Sstevel@tonic-gateLDLIBS +=	$(K5LIBS)
1496543Srie$(TSNETPROG)		:=	LDLIBS += -ltsnet
15010616SSebastien.Roy@Sun.COM$(DLADMPROG)		:=	LDLIBS += -ldladm
1510Sstevel@tonic-gate
1524456Sss150715in.rarpd		:=	LDLIBS += -linetutil -ldlpi
1538485SPeter.Memishian@Sun.COMif_mpadm		:=	LDLIBS += -linetutil -lipmp
1548485SPeter.Memishian@Sun.COMif_mpadm.po		:=	XGETFLAGS += -a
1550Sstevel@tonic-gateroute			:=	CPPFLAGS += -DNDEBUG
15612016SGirish.Moodalbail@Sun.COMndd			:=	LDLIBS += -ldladm -lipadm
1574271Sriegettable in.comsat	:=	LDFLAGS += $(MAPFILE.NGB:%=-M%)
1580Sstevel@tonic-gate
1590Sstevel@tonic-gate.KEEP_STATE:
1600Sstevel@tonic-gate
1610Sstevel@tonic-gate.PARALLEL:
1620Sstevel@tonic-gate
1634162Skupferall: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) THIRDPARTYLICENSE.arp
1640Sstevel@tonic-gate
1650Sstevel@tonic-gate#
1660Sstevel@tonic-gate# message catalog
1670Sstevel@tonic-gate#
1680Sstevel@tonic-gate_msg: $(MSGSUBDIRS) $(POFILE)
1690Sstevel@tonic-gate
1700Sstevel@tonic-gatesyncutil: $(SYNCPROG)
1710Sstevel@tonic-gate
1720Sstevel@tonic-gate$(POFILE): $(POFILES)
1730Sstevel@tonic-gate	$(RM) $@
1740Sstevel@tonic-gate	cat $(POFILES) > $@
1750Sstevel@tonic-gate
1763011Sjbeck%.o: $(CMDINETCOMMONDIR)/%.c
1773011Sjbeck	$(COMPILE.c) -o $@ $<
1780Sstevel@tonic-gate
1796727Sgtbin.telnetd: $(K5TELNETOBJS)
1806727Sgtb	$(LINK.c) $(K5TELNETOBJS) -o $@ $(LDLIBS)
1810Sstevel@tonic-gate	$(POST_PROCESS)
1820Sstevel@tonic-gate
1836727Sgtbin.rlogind: $(K5RLOGINOBJS) $(COMMONOBJS)
1846727Sgtb	$(LINK.c) $(K5RLOGINOBJS) $(COMMONOBJS) -o $@ $(LDLIBS)
1856536Sgtb	$(POST_PROCESS)
1866536Sgtb
1876727Sgtbin.rshd: $(K5RSHDOBJS) $(COMMONOBJS)
1886727Sgtb	$(LINK.c) $(K5RSHDOBJS) $(COMMONOBJS) -o $@ $(LDLIBS)
1890Sstevel@tonic-gate	$(POST_PROCESS)
1900Sstevel@tonic-gate
1910Sstevel@tonic-gatein.tftpd: $(TFTPDOBJS)
1920Sstevel@tonic-gate	$(LINK.c) $(TFTPDOBJS) -o $@ $(LDLIBS)
1930Sstevel@tonic-gate	$(POST_PROCESS)
1940Sstevel@tonic-gate
1950Sstevel@tonic-gatetftpsubs.o: $(OTHERSRC)
1960Sstevel@tonic-gate	$(COMPILE.c) $(OTHERSRC) -o $@
1970Sstevel@tonic-gate	$(POST_PROCESS_O)
1980Sstevel@tonic-gate
1990Sstevel@tonic-gate$(ROOTUSRSBINLINKS):
2000Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
2010Sstevel@tonic-gate
2020Sstevel@tonic-gateinstall: $(PROG) $(ROOTFS_PROG) $(SUBDIRS) .WAIT $(ROOTUSRSBINPROG) \
2030Sstevel@tonic-gate	$(ROOTSBINPROG) $(ROOTUSRSBINLINKS) $(ROOTETCDEFAULTFILES) \
20412643SAnders.Persson@Sun.COM	$(ROOTMANIFEST) $(ROOTSVCMETHOD) THIRDPARTYLICENSE.arp
2054162Skupfer
2064162SkupferTHIRDPARTYLICENSE.arp: arp.c
2074162Skupfer	$(SED) -n '/University of California/,/SUCH DAMAGE/p' arp.c > $@
2084162Skupfer
2094162SkupferCLOBBERFILES += THIRDPARTYLICENSE.arp
2100Sstevel@tonic-gate
2110Sstevel@tonic-gate#
2120Sstevel@tonic-gate# The reason this rule checks for the existence of the
2130Sstevel@tonic-gate# Makefile is that some of the directories do not exist
2140Sstevel@tonic-gate# in our exportable source builds.
2150Sstevel@tonic-gate#
2160Sstevel@tonic-gate$(SUBDIRS): FRC
2170Sstevel@tonic-gate	@if [ -f $@/Makefile  ]; then \
2180Sstevel@tonic-gate		cd $@; pwd; $(MAKE) $(TARGET); \
2190Sstevel@tonic-gate	else \
2200Sstevel@tonic-gate		true; \
2210Sstevel@tonic-gate	fi
2220Sstevel@tonic-gate
2230Sstevel@tonic-gateFRC:
2240Sstevel@tonic-gate
2250Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
2260Sstevel@tonic-gate
2270Sstevel@tonic-gateclean:	$(SUBDIRS)
2280Sstevel@tonic-gate	-$(RM) $(CLEANFILES)
2290Sstevel@tonic-gate
2300Sstevel@tonic-gateclobber: $(SUBDIRS)
2310Sstevel@tonic-gate	-$(RM) $(CLEANFILES) $(CLOBBERFILES)
2320Sstevel@tonic-gate
2330Sstevel@tonic-gatelint: $(LINTSUBDIRS)
23410616SSebastien.Roy@Sun.COM	$(LINT.c) 6to4relay.c $(LDLIBS) -lsocket -ldladm
2350Sstevel@tonic-gate	$(LINT.c) arp.c $(LDLIBS) -lsocket -lnsl
2360Sstevel@tonic-gate	@# $(LINT.c) in.rexecd.c $(LDLIBS) -lbsm -lpam
2370Sstevel@tonic-gate	$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \
2380Sstevel@tonic-gate		-I$(SRC)/head -I$(SRC)/uts/common/ \
2390Sstevel@tonic-gate		-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
2400Sstevel@tonic-gate		-I$(SRC)/lib/gss_mechs/mech_krb5/include \
2410Sstevel@tonic-gate		-I$(SRC)/lib/pam_modules/krb5 \
2420Sstevel@tonic-gate		in.rlogind.c $(COMMONSRCS) $(LDLIBS) -lbsm -lpam -lsocket -lnsl
2430Sstevel@tonic-gate	$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \
2440Sstevel@tonic-gate		-I$(SRC)/head -I$(SRC)/uts/common/ \
2450Sstevel@tonic-gate		-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
2460Sstevel@tonic-gate		-I$(SRC)/lib/gss_mechs/mech_krb5/include \
2470Sstevel@tonic-gate		-I$(SRC)/lib/pam_modules/krb5 \
2480Sstevel@tonic-gate		in.rshd.c $(COMMONSRCS) $(LDLIBS) -lbsm -lpam -lsocket -lnsl
2490Sstevel@tonic-gate	$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 \
2500Sstevel@tonic-gate		-erroff=E_GLOBAL_COULD_BE_STATIC2 \
2510Sstevel@tonic-gate		-I$(SRC)/head -I$(SRC)/uts/common/ \
2520Sstevel@tonic-gate		-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
2530Sstevel@tonic-gate		-I$(SRC)/lib/gss_mechs/mech_krb5/include \
2540Sstevel@tonic-gate		-I$(SRC)/lib/pam_modules/krb5 \
2550Sstevel@tonic-gate		in.telnetd.c $(LDLIBS) -lbsm -lpam -lsocket -lnsl
2568485SPeter.Memishian@Sun.COM	$(LINT.c) if_mpadm.c $(LDLIBS) -lsocket -lnsl -lipmp -linetutil
2570Sstevel@tonic-gate	$(LINT.c) ipaddrsel.c $(LDLIBS) -lsocket -lnsl
2581676Sjpk	$(LINT.c) route.c $(LDLIBS) -lsocket -lnsl -ltsnet
2590Sstevel@tonic-gate	$(LINT.c) syncinit.c $(LDLIBS) -ldlpi
2600Sstevel@tonic-gate	$(LINT.c) syncloop.c $(LDLIBS) -ldlpi
2610Sstevel@tonic-gate	$(LINT.c) syncstat.c $(LDLIBS) -ldlpi
2620Sstevel@tonic-gate	$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 in.rarpd.c $(LDLIBS) \
2630Sstevel@tonic-gate	    -lsocket -lnsl
2640Sstevel@tonic-gate	$(LINT.c) in.tftpd.c ../usr.bin/tftp/tftpsubs.c $(LDLIBS) \
2650Sstevel@tonic-gate	    -lsocket -lnsl
2660Sstevel@tonic-gate
2670Sstevel@tonic-gate# EXPORT DELETE START
2680Sstevel@tonic-gateEXPORT_SRC:
2690Sstevel@tonic-gate	$(RM) Makefile+
2700Sstevel@tonic-gate	sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
2710Sstevel@tonic-gate		< Makefile > Makefile+
2720Sstevel@tonic-gate	$(RM) Makefile
2730Sstevel@tonic-gate	$(MV) Makefile+ Makefile
2740Sstevel@tonic-gate	$(CHMOD) 444 Makefile
2750Sstevel@tonic-gate# EXPORT DELETE END
276