xref: /titanic_41/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile (revision 70025d765b044c6d8594bb965a2247a61e991a99)
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 2004 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
30PINGOBJS=	ping.o ping_aux.o ping_aux6.o
31COMMONOBJS=	ifaddrlist.o
32OBJS=		$(PINGOBJS) $(COMMONOBJS)
33SUIDPROG=	ping
34
35include	../../../Makefile.cmd
36include	../../Makefile.cmd-inet
37
38PINGSRCS=	$(PINGOBJS:.o=.c)
39COMMONSRCS=	$(CMDINETCOMMONDIR)/$(COMMONOBJS:.o=.c)
40SRCS=		$(PINGSRCS) $(COMMONSRCS)
41HDRS=		ping.h $(CMDINETCOMMONDIR)/ifaddrlist.h
42
43$(ROOTUSRSBIN)/ping	:=	FILEMODE= 04555
44$(ROOTUSRSBIN)/ping	:=	OWNER= root
45
46
47CPPFLAGS +=	-I$(CMDINETCOMMONDIR)
48
49# Ping uses the ancillary data feature which is available only through
50# UNIX 98 standards version of Socket interface. This interface is supposed to
51# be accessed by -lxnet. In addition -lsocket and -lnsl are used to
52# capture new not-yet-standard interfaces. Someday -lxnet alone should be enough
53# when IPv6 inspired new interfaces are part of standards.
54LDLIBS +=	-lxnet -lsocket -lnsl -lm
55
56# these #defines are required to use UNIX 98 interfaces
57_D_UNIX98_EXTN = -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
58
59$(PINGOBJS)		:= CPPFLAGS +=	$(_D_UNIX98_EXTN)
60
61LINTFLAGS +=	$(_D_UNIX98_EXTN)
62
63# Setting the above defines to use the UNIX98 ancillary data feature
64# causes lint to output warnings about lint library declarations conflicting
65# with those in the header files. Since we need these features the best
66# course of action is to switch the types of the resulting warnings off
67# when running lint.
68LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 -erroff=E_INCONS_ARG_DECL2 \
69	     -erroff=E_FUNC_DECL_VAR_ARG2
70
71.KEEP_STATE:
72.PARALLEL:
73
74all:	$(PROG)
75
76$(PROG): $(OBJS)
77	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
78	$(POST_PROCESS)
79
80$(COMMONOBJS): $(COMMONSRCS)
81	$(COMPILE.c) $(COMMONSRCS)
82
83install: all $(ROOTUSRSBINPROG)
84
85clean:
86	$(RM) $(OBJS)
87
88lint:	lint_SRCS
89
90include ../../../Makefile.targ
91