17c478bd9Sstevel@tonic-gate#
224fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate# Use is subject to license terms.
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate
67c478bd9Sstevel@tonic-gate#  Copyright (c) 1988, 1989, 1990, 1991, 1992, 1995, 1996, 1997
78a7aa2a5SYuri Pankov#	The Regents of the University of California.  All rights reserved.
87c478bd9Sstevel@tonic-gate#
97c478bd9Sstevel@tonic-gate#  Redistribution and use in source and binary forms, with or without
107c478bd9Sstevel@tonic-gate#  modification, are permitted provided that: (1) source code distributions
117c478bd9Sstevel@tonic-gate#  retain the above copyright notice and this paragraph in its entirety, (2)
127c478bd9Sstevel@tonic-gate#  distributions including binary code include the above copyright notice and
137c478bd9Sstevel@tonic-gate#  this paragraph in its entirety in the documentation or other materials
147c478bd9Sstevel@tonic-gate#  provided with the distribution, and (3) all advertising materials mentioning
157c478bd9Sstevel@tonic-gate#  features or use of this software display the following acknowledgement:
167c478bd9Sstevel@tonic-gate#  ``This product includes software developed by the University of California,
177c478bd9Sstevel@tonic-gate#  Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
187c478bd9Sstevel@tonic-gate#  the University nor the names of its contributors may be used to endorse
197c478bd9Sstevel@tonic-gate#  or promote products derived from this software without specific prior
207c478bd9Sstevel@tonic-gate#  written permission.
217c478bd9Sstevel@tonic-gate#  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
227c478bd9Sstevel@tonic-gate#  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
237c478bd9Sstevel@tonic-gate#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gatePROG=		traceroute
270406ceaaSmeemOBJS=		traceroute.o traceroute_aux.o traceroute_aux6.o
280406ceaaSmeemSRCS=		$(OBJS:.o=.c)
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateinclude	../../../Makefile.cmd
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gate$(ROOTUSRSBIN)/traceroute	:=	FILEMODE= 04555
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gate# Traceroute uses the ancillary data feature which is available only through
357c478bd9Sstevel@tonic-gate# UNIX 98 standards version of Socket interface. This interface is supposed to
368a7aa2a5SYuri Pankov# be accessed by -lxnet. In addition -lsocket is used to
377c478bd9Sstevel@tonic-gate# capture new not-yet-standard interfaces. Someday -lxnet alone should be enough
387c478bd9Sstevel@tonic-gate# when IPv6 inspired new interfaces are part of standards.
398a7aa2a5SYuri PankovLDLIBS +=	-lxnet -lsocket -linetutil
407c478bd9Sstevel@tonic-gate
410406ceaaSmeem# These #defines are required to use UNIX 98 interfaces
420406ceaaSmeemCPPFLAGS += -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gate#
457c478bd9Sstevel@tonic-gate# Setting the above defines to use the UNIX98 ancillary data feature
467c478bd9Sstevel@tonic-gate# causes lint to output warnings about lint library declarations
477c478bd9Sstevel@tonic-gate# conflicting with those in the header files. Since we need these
487c478bd9Sstevel@tonic-gate# features, the best course of action is to switch the types of the
497c478bd9Sstevel@tonic-gate# resulting warnings off when running lint.
507c478bd9Sstevel@tonic-gate#
517c478bd9Sstevel@tonic-gateLINTFLAGS +=	-erroff=E_FUNC_DECL_VAR_ARG2 -erroff=E_INCONS_ARG_DECL2 \
527c478bd9Sstevel@tonic-gate		-erroff=E_INCONS_ARG_USED2 -erroff=E_INCONS_VAL_TYPE_DECL2
537c478bd9Sstevel@tonic-gate
54*d3b5f563SJohn LevonCERRWARN +=	$(CNOWARN_UNINIT)
557014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-clobbered
567014882cSRichard Lowe
577c478bd9Sstevel@tonic-gate.KEEP_STATE:
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gateall:	$(PROG)
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gate$(PROG): $(OBJS)
627c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
637c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gateinstall: all $(ROOTUSRSBINPROG)
667c478bd9Sstevel@tonic-gate
678a7aa2a5SYuri Pankovclean:
687c478bd9Sstevel@tonic-gate	$(RM) $(OBJS)
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gatelint:	lint_SRCS
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gateinclude ../../../Makefile.targ
73