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
506e1a714Sraf# Common Development and Distribution License (the "License").
606e1a714Sraf# 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#
217c478bd9Sstevel@tonic-gate#
22e11c3f44Smeem# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
25a73be61aSHans Rosenfeld# Copyright 2021 Tintri by DDN, Inc. All rights reserved.
26a73be61aSHans Rosenfeld#
277c478bd9Sstevel@tonic-gate
28e11c3f44SmeemPROG		= in.mpathd
29e11c3f44SmeemROOTFS_PROG	= $(PROG)
30e11c3f44SmeemOBJS		= mpd_tables.o mpd_main.o mpd_probe.o
31e11c3f44SmeemDEFAULTFILES	= mpathd.dfl
32a73be61aSHans RosenfeldSVCMETHOD	= net-ipmp
33a73be61aSHans RosenfeldMANIFEST	= network-ipmp.xml
34a7872406Smeem
357c478bd9Sstevel@tonic-gateinclude ../../../Makefile.cmd
367c478bd9Sstevel@tonic-gate
37e11c3f44SmeemROOTCMDDIR	= $(ROOT)/lib/inet
38a73be61aSHans RosenfeldROOTMANIFESTDIR	= $(ROOTSVCNETWORK)
39e11c3f44Smeem
40e11c3f44SmeemPOFILE		= $(PROG).po
41*d17be682SRichard LowePOFILES		= $(OBJS:%.o=%.po)
427c478bd9Sstevel@tonic-gate
43bd0ce624SYuri PankovCSTD		= $(CSTD_GNU99)
44e3e7cd29Smeem
457c478bd9Sstevel@tonic-gate#
467c478bd9Sstevel@tonic-gate# We need access to the ancillary data features which are only available
47e3e7cd29Smeem# via the SUS standards.  Further, C99 support requires SUSv3 or higher.
487c478bd9Sstevel@tonic-gate#
49e3e7cd29SmeemCPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
50e11c3f44SmeemLDLIBS	+= -lsocket -lnsl -lsysevent -lnvpair -lipmp -linetutil -ldlpi
517c478bd9Sstevel@tonic-gate
52d3b5f563SJohn LevonCERRWARN += $(CNOWARN_UNINIT)
537014882cSRichard Lowe
54e11c3f44Smeem#
55e11c3f44Smeem# Instrument in.mpathd with CTF data to ease debugging.
56e11c3f44Smeem#
57e11c3f44SmeemCTFCONVERT_HOOK = && $(CTFCONVERT_O)
58e11c3f44SmeemCTFMERGE_HOOK = && $(CTFMERGE) -L VERSION -o $@ $(OBJS)
59e11c3f44Smeem$(OBJS) := CFLAGS += $(CTF_FLAGS)
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gate.KEEP_STATE:
627c478bd9Sstevel@tonic-gate
63a7872406Smeemall:		$(PROG)
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gate$(PROG):	$(OBJS)
66e11c3f44Smeem		$(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(CTFMERGE_HOOK)
677c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
687c478bd9Sstevel@tonic-gate
69a73be61aSHans Rosenfeldcheck:		$(CHKMANIFEST)
707c478bd9Sstevel@tonic-gate
71a73be61aSHans Rosenfeldinstall:	all $(ROOTCMD) $(ROOTMANIFEST) $(ROOTSVCMETHOD) \
72e11c3f44Smeem		$(ROOTETCDEFAULTFILES)
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gateclean:
757c478bd9Sstevel@tonic-gate		$(RM) $(OBJS)
767c478bd9Sstevel@tonic-gate
77a73be61aSHans Rosenfeld$(POFILE):	$(POFILES)
787c478bd9Sstevel@tonic-gate		$(RM) $@
797c478bd9Sstevel@tonic-gate		$(CAT) $(POFILES) > $@
807c478bd9Sstevel@tonic-gate
817c478bd9Sstevel@tonic-gateinclude ../../../Makefile.targ
82