# ----------------------------------------------------------------------------
#  $RCSfile: Makefile,v $
# 
# $Revision: 1.16 $
#   $Author: larse $
#     $Date: 2000/06/08 19:23:45 $
#    $State: Exp $
# ----------------------------------------------------------------------------
# Copyright 1999-2000, Lars Eggert <larse@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the "Artistic License" which comes with this
# Kit.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Artistic License for more details.
# ----------------------------------------------------------------------------
#
# $Log: Makefile,v $
# Revision 1.16  2000/06/08 19:23:45  larse
# Not using local libpcap directory by default.
#
# Revision 1.15  2000/06/07 16:43:16  larse
# Moved software over to sourceforge.net under the Artistic License. No
# functional changes to latest release.
#
# Revision 1.14  1999/08/21 01:05:11  larse
# Release 1.1.
#
# Revision 1.13  1999/08/10 22:15:58  larse
# Preliminary RIP support (still lacking most options.)
#
# Revision 1.12  1999/05/20 21:20:06  larse
# Now compiles independent of inet includes. (First step towards
# multi-platform support.)
#
# Revision 1.11  1999/05/18 00:47:21  larse
# Added ARP/RARP and DVMRP. Factored out common code to basics.c. Added
# IGMP traceroute (untested).
#
# Revision 1.10  1999/05/12 13:04:58  larse
# Added support for SAP and SAP. Removed duplicate includes from other
# sources. Changed output of IP router alert option in last version, but
# forgot to document.
#
# Revision 1.9  1999/05/11 17:45:05  larse
# Initial support for IGMPv4, mostly missing is support for DVMRP.
#
# Revision 1.8  1999-03-29 22:05:50-08  larse
# Updated README and Makefile for release.
#
# Revision 1.7  1999/03/29 18:25:33  larse
# Added target to roll distribution tarball.
#
# Revision 1.6  1999/03/26 00:59:43  larse
# Now supporting options to inhibit host name lookups, hide link layer
# headers and show payload data. Documented the code better. Fixed a
# small bug in IP option handling. First cut at a README.
#
# Revision 1.5  1999/03/25 20:23:01  larse
# Now printing a note when unsupported packet types are
# encountered. Libpcap location now configurable, this allows
# compilation with CAIRN's broken libpcap (fixed one in
# /home/d7unsupp/FreeBSD). Minor other changes.
#
# Revision 1.4  1999/03/24 00:29:55  larse
# Added support for IPIP tunnels, IPsec (AH and ESP) and raw data
# output. Fixed bugs in the ICMPv4 module. Fixed bug printing certain
# options in the IP module. Minor changes to other modules, mostly to
# write raw data where it was omitted previously.
#
# Revision 1.3  1999/03/23 03:07:04  larse
# Added support for TCP and UDP. Cleaned up IP option handling and ICMP.
#
# Revision 1.1  1999/03/19 04:22:48  larse
# Initial revision
# ----------------------------------------------------------------------------

# if libpcap is not in your default include path, define it here:
# pcap = /home/d7unsupp/FreeBSD

CFLAGS = -O2 -g -Wall -pipe
LDLIBS = -lpcap

.ifdef PCAP
  CFLAGS += -I${pcap}/include
  LDLIBS += -L${pcap}/lib
.endif


sources = ipdump.c ipv4.c icmpv4.c scan.c indent.c ether.c udp.c tcp.c raw.c\
          esp.c ah.c igmpv4.c sap.c sdp.c dvmrp.c basics.c arp.c rip.c

objects = ${sources:.c=.o}

.PHONY: clean depend

ipdump: ${objects}
	${CC} ${CFLAGS} ${LDFLAGS} ${objects} ${LDLIBS} -o $@
	chmod a+rX $@

clean:
	rm -f *.ln *.o *~ *.core ipdump gmon.out ipdump.tar.gz

depend:
	mkdep ${CFLAGS} ${sources}

dist:
	cd .. ;\
	tar cvf ipdump.tar ipdump/*.[ch] ipdump/Makefile ipdump/README ;\
	gzip ipdump.tar
	echo "GENERATE A CVS TAG FOR AN OFFICIAL RELEASE."
