xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile (revision 7f7322febbcfe774b7270abc3b191c094bfcc517)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29PROG=		ping
30OBJS=		ping.o ping_aux.o ping_aux6.o
31SRCS=		$(OBJS:.o=.c)
32
33include	../../../Makefile.cmd
34
35$(ROOTUSRSBIN)/ping	:=	FILEMODE= 04555
36$(ROOTUSRSBIN)/ping	:=	OWNER= root
37
38# Ping uses the ancillary data feature which is available only through
39# UNIX 98 standards version of Socket interface. This interface is supposed to
40# be accessed by -lxnet. In addition -lsocket and -lnsl are used to
41# capture new not-yet-standard interfaces. Someday -lxnet alone should be enough
42# when IPv6 inspired new interfaces are part of standards.
43LDLIBS +=	-lxnet -lsocket -lnsl -lm -linetutil
44
45# These #defines are required to use UNIX 98 interfaces
46CPPFLAGS += -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
47
48# Setting the above defines to use the UNIX98 ancillary data feature
49# causes lint to output warnings about lint library declarations conflicting
50# with those in the header files. Since we need these features the best
51# course of action is to switch the types of the resulting warnings off
52# when running lint.
53LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 -erroff=E_INCONS_ARG_DECL2
54
55.KEEP_STATE:
56.PARALLEL:
57
58all:	$(PROG)
59
60$(PROG): $(OBJS)
61	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
62	$(POST_PROCESS)
63
64install: all $(ROOTUSRSBINPROG)
65
66clean:
67	$(RM) $(OBJS)
68
69lint:	lint_SRCS
70
71include ../../../Makefile.targ
72