Home | History | Annotate | Download | only in snoop
      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 (the "License").
      6 # You may not use this file except in compliance with the License.
      7 #
      8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9 # or http://www.opensolaris.org/os/licensing.
     10 # See the License for the specific language governing permissions
     11 # and limitations under the License.
     12 #
     13 # When distributing Covered Code, include this CDDL HEADER in each
     14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15 # If applicable, add the following below this CDDL HEADER, with the
     16 # fields enclosed by brackets "[]" replaced with your own identifying
     17 # information: Portions Copyright [yyyy] [name of copyright owner]
     18 #
     19 # CDDL HEADER END
     20 
     21 #
     22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 
     26 PROG=	snoop
     27 OBJS=	nfs4_xdr.o snoop.o snoop_aarp.o snoop_adsp.o snoop_aecho.o \
     28 	snoop_apple.o snoop_arp.o snoop_atp.o snoop_bparam.o \
     29 	snoop_capture.o snoop_dhcp.o snoop_dhcpv6.o snoop_display.o \
     30 	snoop_dns.o snoop_ether.o \
     31 	snoop_filter.o snoop_http.o snoop_icmp.o snoop_igmp.o snoop_ip.o \
     32 	snoop_ipaddr.o snoop_ipsec.o snoop_ldap.o snoop_mip.o snoop_mount.o \
     33 	snoop_nbp.o snoop_netbios.o snoop_nfs.o snoop_nfs3.o snoop_nfs4.o \
     34 	snoop_nfs_acl.o snoop_nis.o snoop_nisplus.o snoop_nlm.o snoop_ntp.o \
     35 	snoop_pf.o snoop_ospf.o snoop_ospf6.o snoop_pmap.o snoop_ppp.o \
     36 	snoop_pppoe.o snoop_rip.o snoop_rip6.o snoop_rpc.o snoop_rpcprint.o \
     37 	snoop_rpcsec.o snoop_rport.o snoop_rquota.o snoop_rstat.o snoop_rtmp.o \
     38 	snoop_sctp.o snoop_slp.o snoop_smb.o snoop_socks.o snoop_solarnet.o \
     39 	snoop_tcp.o snoop_tftp.o snoop_udp.o snoop_zip.o snoop_ctl.o \
     40 	ds_xdr.o ds_filehandle_xdr.o
     41 
     42 SRCS=	$(OBJS:.o=.c)
     43 HDRS=	snoop.h snoop_mip.h at.h snoop_ospf.h snoop_ospf6.h nfs4_prot.h \
     44 	ds_prot.h ds_nfs_com.h nfs4_cmn.h
     45 
     46 PROTOCOL_DIR	= $(SRC)/head/rpcsvc
     47 NFS_DIR		= $(SRC)/uts/common/fs/nfs
     48 DERIVED_HDRS	= ds_prot.h ds_nfs_com.h
     49 DERIVED_FILES	= ds_xdr.c ds_filehandle_xdr.c ds_nfs_com.c $(DERIVED_HDRS)
     50 
     51 include	../../../Makefile.cmd
     52 
     53 CPPFLAGS += -I. -I$(SRC)/common/net/dhcp
     54 LDLIBS += -ldhcputil -ldlpi -lsocket -lnsl -ltsol
     55 LDFLAGS += $(MAPFILE.NGB:%=-M%)
     56 
     57 .KEEP_STATE:
     58 
     59 .PARALLEL: $(OBJS)
     60 
     61 all:	$(PROG)
     62 
     63 $(PROG): $(DERIVED_HDRS) $(OBJS) $(MAPFILE.NGB)
     64 	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
     65 	$(POST_PROCESS)
     66 
     67 install:	all $(ROOTUSRSBINPROG)
     68 
     69 clean:
     70 	$(RM) $(OBJS)
     71 	$(RM) $(DERIVED_FILES)
     72 
     73 lint:	lint_SRCS
     74 
     75 snoop_ctl.o: snoop_ctl.c $(DERIVED_HDRS)
     76 	$(COMPILE.c) -DUSE_FOR_SNOOP -o $@ snoop_ctl.c
     77 
     78 ds_filehandle_xdr.c: $(NFS_DIR)/ds_filehandle_xdr.c
     79 	$(CP) $(NFS_DIR)/ds_filehandle_xdr.c ds_filehandle_xdr.c
     80 
     81 ds_filehandle_xdr.o: ds_filehandle_xdr.c
     82 	$(COMPILE.c) -DUSE_FOR_SNOOP -o $@ ds_filehandle_xdr.c
     83 
     84 ds_xdr.c: $(PROTOCOL_DIR)/ds_prot.x ds_prot.h
     85 	$(RPCGEN) -C -DUSE_FOR_SNOOP -c $(PROTOCOL_DIR)/ds_prot.x | \
     86 		$(EGREP) -v '^#include.+/ds_prot\.h"' > $@
     87 
     88 ds_xdr.o: ds_xdr.c $(DERIVED_HDRS)
     89 	$(COMPILE.c) -DUSE_FOR_SNOOP -o $@ ds_xdr.c
     90 
     91 ds_prot.h: $(PROTOCOL_DIR)/ds_prot.x ds_nfs_com.h
     92 	$(RPCGEN) -C -DUSE_FOR_SNOOP -h $(PROTOCOL_DIR)/ds_prot.x >$@ 
     93 
     94 ds_nfs_com.h: $(PROTOCOL_DIR)/ds_nfs_com.x
     95 	$(RPCGEN) -C -DUSE_FOR_SNOOP -h $(PROTOCOL_DIR)/ds_nfs_com.x >$@ 
     96 
     97 include	../../../Makefile.targ
     98