xref: /titanic_50/usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
16e91bba0SGirish Moodalbail#
26e91bba0SGirish Moodalbail# CDDL HEADER START
36e91bba0SGirish Moodalbail#
46e91bba0SGirish Moodalbail# The contents of this file are subject to the terms of the
56e91bba0SGirish Moodalbail# Common Development and Distribution License (the "License").
66e91bba0SGirish Moodalbail# You may not use this file except in compliance with the License.
76e91bba0SGirish Moodalbail#
86e91bba0SGirish Moodalbail# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96e91bba0SGirish Moodalbail# or http://www.opensolaris.org/os/licensing.
106e91bba0SGirish Moodalbail# See the License for the specific language governing permissions
116e91bba0SGirish Moodalbail# and limitations under the License.
126e91bba0SGirish Moodalbail#
136e91bba0SGirish Moodalbail# When distributing Covered Code, include this CDDL HEADER in each
146e91bba0SGirish Moodalbail# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156e91bba0SGirish Moodalbail# If applicable, add the following below this CDDL HEADER, with the
166e91bba0SGirish Moodalbail# fields enclosed by brackets "[]" replaced with your own identifying
176e91bba0SGirish Moodalbail# information: Portions Copyright [yyyy] [name of copyright owner]
186e91bba0SGirish Moodalbail#
196e91bba0SGirish Moodalbail# CDDL HEADER END
206e91bba0SGirish Moodalbail#
216e91bba0SGirish Moodalbail#
226e91bba0SGirish Moodalbail# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
236e91bba0SGirish Moodalbail# Use is subject to license terms.
246e91bba0SGirish Moodalbail#
256e91bba0SGirish Moodalbail#
266e91bba0SGirish Moodalbail
276e91bba0SGirish MoodalbailPROG =		ipadm
286e91bba0SGirish MoodalbailROOTFS_PROG =	$(PROG)
296e91bba0SGirish MoodalbailLOCALOBJS=	ipadm.o
306e91bba0SGirish MoodalbailCOMMONOBJS=
316e91bba0SGirish MoodalbailOBJS=		$(LOCALOBJS) $(COMMONOBJS)
326e91bba0SGirish Moodalbail
336e91bba0SGirish Moodalbailinclude ../../../Makefile.cmd
346e91bba0SGirish Moodalbailinclude ../../Makefile.cmd-inet
356e91bba0SGirish Moodalbail
366e91bba0SGirish MoodalbailXGETFLAGS += 	-a -x $(PROG).xcl
376e91bba0SGirish MoodalbailLOCALSRCS=	$(LOCALOBJS:%.o=%.c)
386e91bba0SGirish MoodalbailCOMMONSRCS=	$(CMDINETCOMMONDIR)/$(COMMONOBJS:%.o=%.c)
396e91bba0SGirish MoodalbailSRCS=		$(LOCALSRCS) $(COMMONSRCS)
406e91bba0SGirish Moodalbail
416e91bba0SGirish MoodalbailCPPFLAGS +=	-I$(CMDINETCOMMONDIR)
42*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-label
43*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-uninitialized
446e91bba0SGirish MoodalbailLDLIBS +=       -linetutil -lipadm -lnvpair
456e91bba0SGirish MoodalbailLINTFLAGS +=	-m
466e91bba0SGirish Moodalbail
476e91bba0SGirish MoodalbailROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%)
486e91bba0SGirish Moodalbail
496e91bba0SGirish Moodalbail# ipadm uses the ancillary data feature which is available only through
506e91bba0SGirish Moodalbail# UNIX 98 standards version of Socket interface. This interface is supposed to
516e91bba0SGirish Moodalbail# be accessed by -lxnet. In addition -lsocket is used to capture new
526e91bba0SGirish Moodalbail# not-yet-standard interfaces. Someday -lxnet alone should be enough when IPv6
536e91bba0SGirish Moodalbail# inspired new interfaces are part of standards.
546e91bba0SGirish MoodalbailLDLIBS +=	-lxnet -lsocket
556e91bba0SGirish Moodalbail
566e91bba0SGirish Moodalbail# these #defines are required to use UNIX 98 interfaces
576e91bba0SGirish Moodalbail_D_UNIX98_EXTN= -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
586e91bba0SGirish Moodalbail
596e91bba0SGirish Moodalbail$(OBJS)		:= CPPFLAGS +=	$(_D_UNIX98_EXTN)
606e91bba0SGirish Moodalbail
616e91bba0SGirish MoodalbailLINTFLAGS +=	$(_D_UNIX98_EXTN)
626e91bba0SGirish Moodalbail
636e91bba0SGirish Moodalbail$(ROOTCFGDIR)/ipadm.conf := FILEMODE= 644
646e91bba0SGirish Moodalbail
656e91bba0SGirish Moodalbail#
666e91bba0SGirish Moodalbail# Instrument ipadm with CTF data to ease debugging.
676e91bba0SGirish Moodalbail#
686e91bba0SGirish MoodalbailCTFCONVERT_HOOK = && $(CTFCONVERT_O)
696e91bba0SGirish MoodalbailCTFMERGE_HOOK = && $(CTFMERGE) -L VERSION -o $@ $(OBJS)
706e91bba0SGirish Moodalbail$(OBJS) := CFLAGS += $(CTF_FLAGS)
716e91bba0SGirish Moodalbail
726e91bba0SGirish Moodalbail.KEEP_STATE:
736e91bba0SGirish Moodalbail
746e91bba0SGirish Moodalbailall:	$(ROOTFS_PROG)
756e91bba0SGirish Moodalbail
766e91bba0SGirish Moodalbail$(PROG):	$(OBJS)
776e91bba0SGirish Moodalbail	$(LINK.c) $(OBJS) -o $@ $(LDLIBS) $(CTFMERGE_HOOK)
786e91bba0SGirish Moodalbail	$(POST_PROCESS)
796e91bba0SGirish Moodalbail
806e91bba0SGirish Moodalbailinstall: all $(ROOTSBINPROG) $(ROOTCFGDIR) $(ROOTCFGFILES) $(ROOTUSRSBINLINKS)
816e91bba0SGirish Moodalbail
826e91bba0SGirish Moodalbail$(ROOTUSRSBINLINKS):
836e91bba0SGirish Moodalbail	-$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
846e91bba0SGirish Moodalbail
856e91bba0SGirish Moodalbailclean:
866e91bba0SGirish Moodalbail	$(RM) $(OBJS)
876e91bba0SGirish Moodalbail
886e91bba0SGirish Moodalbaillint:	lint_SRCS
896e91bba0SGirish Moodalbail
906e91bba0SGirish Moodalbail$(ROOTCFGDIR):
916e91bba0SGirish Moodalbail	$(INS.dir)
926e91bba0SGirish Moodalbail
936e91bba0SGirish Moodalbail$(ROOTCFGDIR)/%: $(ROOTCFGDIR) %
946e91bba0SGirish Moodalbail	$(INS.file)
956e91bba0SGirish Moodalbail
966e91bba0SGirish Moodalbailinclude ../../../Makefile.targ
97