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#
22*e11c3f44Smeem# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate
26*e11c3f44SmeemPROG		= in.mpathd
27*e11c3f44SmeemROOTFS_PROG	= $(PROG)
28*e11c3f44SmeemOBJS		= mpd_tables.o mpd_main.o mpd_probe.o
29*e11c3f44SmeemSRCS		= $(OBJS:%.o=%.c)
30*e11c3f44SmeemDEFAULTFILES	= mpathd.dfl
31a7872406Smeem
327c478bd9Sstevel@tonic-gateinclude ../../../Makefile.cmd
337c478bd9Sstevel@tonic-gate
34*e11c3f44SmeemROOTCMDDIR	= $(ROOT)/lib/inet
35*e11c3f44Smeem
36*e11c3f44SmeemPOFILE		= $(PROG).po
37*e11c3f44SmeemPOFILES		= $(SRCS:%.c=%.po)
387c478bd9Sstevel@tonic-gate
39*e11c3f44SmeemC99MODE		= $(C99_ENABLE)
40e3e7cd29Smeem
417c478bd9Sstevel@tonic-gate#
427c478bd9Sstevel@tonic-gate# We need access to the ancillary data features which are only available
43e3e7cd29Smeem# via the SUS standards.  Further, C99 support requires SUSv3 or higher.
447c478bd9Sstevel@tonic-gate#
45e3e7cd29SmeemCPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
46*e11c3f44SmeemLDLIBS	+= -lsocket -lnsl -lsysevent -lnvpair -lipmp -linetutil -ldlpi
47*e11c3f44SmeemLINTFLAGS += -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_ARG_USED2
487c478bd9Sstevel@tonic-gate
49*e11c3f44Smeem#
50*e11c3f44Smeem# Instrument in.mpathd with CTF data to ease debugging.
51*e11c3f44Smeem#
52*e11c3f44SmeemCTFCONVERT_HOOK = && $(CTFCONVERT_O)
53*e11c3f44SmeemCTFMERGE_HOOK = && $(CTFMERGE) -L VERSION -o $@ $(OBJS)
54*e11c3f44Smeem$(OBJS) := CFLAGS += $(CTF_FLAGS)
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gate.KEEP_STATE:
577c478bd9Sstevel@tonic-gate
58a7872406Smeemall:		$(PROG)
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gate$(PROG):	$(OBJS)
61*e11c3f44Smeem		$(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(CTFMERGE_HOOK)
627c478bd9Sstevel@tonic-gate		$(POST_PROCESS)
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gateinclude ../Makefile.lib
657c478bd9Sstevel@tonic-gate
66*e11c3f44Smeem$(ROOTLIBINETPROG):
67*e11c3f44Smeem		$(RM) $@; $(SYMLINK) ../../../lib/inet/$(PROG) $@
68*e11c3f44Smeem
697c478bd9Sstevel@tonic-gate$(ROOTSBINPROG):
70*e11c3f44Smeem		$(RM) $@; $(SYMLINK) ../lib/inet/$(PROG) $@
717c478bd9Sstevel@tonic-gate
72*e11c3f44Smeeminstall:	all $(ROOTLIBINETPROG) $(ROOTSBINPROG) $(ROOTCMD) \
73*e11c3f44Smeem		$(ROOTETCDEFAULTFILES)
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gateclean:
767c478bd9Sstevel@tonic-gate		$(RM) $(OBJS)
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gatelint:		lint_SRCS
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gate$(POFILE): 	$(POFILES)
817c478bd9Sstevel@tonic-gate		$(RM) $@
827c478bd9Sstevel@tonic-gate		$(CAT) $(POFILES) > $@
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gateinclude ../../../Makefile.targ
85