⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile.dj

📁 This directory contains source code for tcpdump, a tool for network monitoring and data acquisition
💻 DJ
字号:
#
#  GNU Makefile for tcpdump/dos.
#
#  G.Vanem <giva@bgnett.no> 1999
#
#  Targets:
#    GNU C 2.7+ and djgpp2 DOS-extender
#
#  Watt-32 tcp/ip (ver. 2.1.5 or later) and optionally
#  RPC libraries are required. Get them from:
#    http://www.bgnett.no/~giva/
#

.SUFFIXES: .exe

#
# Change paths to suite your setup.
#
WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
SSL_ROOT    = /net/openssl.098
ZLIB_ROOT   = /djgpp/contrib/zlib
RSVP_ROOT   = ./rsvpd
PCAP_ROOT   = ./pcap
LFN = n

#
# Include 32-bit driver support.
# This setting MUST match same setting in $(PCAP_ROOT)/common.dj.
# Do 'make clean' in pcap directories after changing this.
#
USE_32BIT_DRIVERS = 1

#
# Put interrupt sensitive code/data in locked sections
# This setting MUST match same setting in $(PCAP_ROOT)/common.dj.
# Do 'make clean' in pcap directories after changing this.
#
USE_SECTION_LOCKING = 0

#
# Include OpenSSL support in _esp.c
#
USE_SSL = 0

#
# Include RSVP decoding (not yet).
#
USE_RSVP = 0

#
# Include IPv6/ICMPv6/DHCPv6 decoding
#
USE_INET6 = 1

#
# Use getrpcbynumber() in _sunrpc.c
#
USE_RPC = 0

#
# Use Zlib decompression in _ipcomp.c
#
USE_ZLIB = 0

#
# Use conio/stdio screen writing
#
USE_CONIO = 1

#
# Use Fortify malloc library (for developement versions only)
#
USE_FORTIFY = 0

#
# Use YAMD malloc debugger (for developement versions only)
#
USE_YAMD = 0

#
# Set to 1 to create a detailed map-file.
#
MAKE_MAPFILE = 1

#
# Set to 1 to strip .exe-files
#
STRIP_EXE = 0

#
# Add or remove flags:
#  PRINT_NETBIOS_DETAILS -> detailed NetBIOS (nbt/netbeui) packets
#  PRINT_DECNET_DETAILS  -> detailed DEC-Net packets
#  BDEBUG                -> print extra BPF dump information
#

CC_DEFS = -DTCPDUMP_VERSION=\"3.61\" -DPRINT_DECNET_DETAILS \
          -DSIZEOF_LONG_LONG=8 -DUSE_FAST_CKSUM             \
         #-DPPP -DPRINT_NETBIOS_DETAILS

CC_OPTIM= -g -gcoff -O2 -mcpu=i486 -falign-loops=2 -falign-jumps=2 \
          -falign-functions=2 -fno-strength-reduce                 \
         #-fomit-frame-pointer

CC_INCL = -I$(PCAP_ROOT)

SOURCES = _afs.c _ah.c _anep.c _arp.c _ascii.c _atalk.c _atm.c _ax25.c  \
          _bgp.c _bootp.c _bxxp.c _chdlc.c _cip.c _corba.c _decnet.c    \
          _dhcp6.c _domain.c _dvmrp.c _egp.c _esp.c _ether.c _fddi.c    \
          _fr.c _frag6.c _giop.c _giop2.c _gre.c _icmp.c _icmp6.c       \
          _igrp.c _cdp.c _cnfp.c _stp.c _iiop.c _ip.c _ip6.c _ip6opts.c \
          _ipcomp.c _ipx.c _isakmp.c _isoclns.c _krb.c _llc.c _mobile.c \
          _netbios.c _oncrpc.c _lane.c _l2tp.c _lcp.c _nfs.c _radius.c  \
          _ntp.c _null.c _ospf.c _ospf6.c _pim.c _ppp.c _pppoe.c _raw.c \
          _rip.c _ripng.c _rt6.c _rx.c _sl.c _smb.c _snmp.c _srm2.c     \
          _sunrpc.c _sunrpcr.c _telnet.c _tcp.c _tftp.c _token.c _udp.c \
          _timed.c _vjc.c _vrrp.c _w3mux.c _w3ng.c _wb.c _xtp.c         \
          a2name.c config.c etherent.c out.c parsenfs.c smbutil.c       \
          tcpdump.c util.c snprintf.c savestr.c

OBJS = $(strip $(SOURCES:.c=.o))
CC   = gcc.exe
LD   = ld.exe

ifeq ($(STRIP_EXE),1)
  LFLAGS += -s
endif

ifeq ($(USE_INET6),1)
  CC_DEFS += -DUSE_INET6
endif

ifeq ($(USE_CONIO),1)
  CC_DEFS += -DUSE_CONIO
endif

ifeq ($(USE_RPC),1)
  CC_DEFS += -DUSE_RPC
  LIBS    += $(WATT32_ROOT)/rpc/lib/librpc.a
endif

ifeq ($(USE_ZLIB),1)
  CC_DEFS += -DUSE_ZLIB
  CC_INCL += -I$(ZLIB_ROOT)
  LIBS    += $(ZLIB_ROOT)/libz.a
endif

ifeq ($(USE_RSVP),1)
  CC_DEFS += -DUSE_RSVP
  LIBS	  += $(RSVP_ROOT)/librsvp.a    \
			 $(RSVP_ROOT)/rsvp_specs.o \
			 $(RSVP_ROOT)/rapi_fmt.o   \
			 $(RSVP_ROOT)/rapi_lib.o   \
			 $(RSVP_ROOT)/rsvp_objs.o  \
			 $(RSVP_ROOT)/rsvp_bord.o  \
			 $(RSVP_ROOT)/linux/liblinuxtc.a
endif

ifeq ($(USE_SSL),1)
  CC_DEFS += -DUSE_SSL
  CC_INCL += -I$(SSL_ROOT)/openssl -I$(SSL_ROOT)
  LIBS	  += $(SSL_ROOT)/lib/libcrypt.a
endif

LIBS  += $(PCAP_ROOT)/libpcap.a $(WATT32_ROOT)/lib/libwatt.a
CFLAGS = -Wall -Winline $(CC_INCL) $(CC_OPTIM) $(CC_DEFS)

ifeq ($(USE_FORTIFY),1)
  CFLAGS += -DUSE_FORTIFY
endif

ifeq ($(USE_32BIT_DRIVERS),1)
  CFLAGS += -DUSE_32BIT_DRIVERS
endif

ifeq ($(USE_YAMD),1)
  CFLAGS  += -DUSE_LD_WRAP -DHASH_PROFILE -DYAMD_VERSION=\"0.2\"
  SOURCES += yamd.c
  LFLAGS  += -Wl,--wrap,malloc,--wrap,realloc,--wrap,free
endif


ifeq ($(MAKE_MAPFILE),1)
  LINK = redir -e $*.map $(CC) -Wl,--print-map,--sort-common #,--cref
else
  LINK = $(CC)
endif

ifeq ($(USE_SECTION_LOCKING),1)
  CFLAGS += -DUSE_SECTION_LOCKING
  LINK  = redir -o $*.map $(LD) --script $(PCAP_ROOT)/pm_drvr/djgpp.lck \
                                --print-map --sort-common
  LIBS += $(DJDIR)/lib/crt0.o $(DJDIR)/lib/libc.a $(GCCLIB)/libgcc.a
endif

PROGRAMS = tcpdump.exe ascii.exe capconv.exe snoop2ca.exe
MAPFILES = $(PROGRAMS:.exe=.map)

all: $(PROGRAMS)
	@echo Welcome to tcpdump!

tcpdump.exe: $(OBJS) $(PCAP_ROOT)/libpcap.a $(WATT32_ROOT)/lib/libwatt.a
	$(LINK) -o $@ $(OBJS) $(LFLAGS) $(LIBS)
ifeq ($(USE_SECTION_LOCKING),1)
	stubify $@
endif
	@echo

ascii.exe: _ascii.c
	$(CC) $(CFLAGS) -DTEST_PROG -o $@ $^ $(LFLAGS)
	@echo

capconv.exe: capconv.c
	$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS)
	@echo

snoop2ca.exe: snoop2ca.c
	$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS)
	@echo

.c.o:
	$(CC) -c $(strip $(CFLAGS)) $<
	@echo

clean:
	rm -f $(OBJS) $(MAPFILES) Makefile.bak

vclean: clean
	rm -f $(PROGRAMS)

#
# Generate dependencies. Due to some hacks in gcc 2.95 and djgpp 2.03
# we must prevent "$(DJDIR)/bin/../include/sys/version.h" from beeing
# included in dependency output (or else this makefile cannot be used on
# another machine). We therefore use a special 'specs' file during
# pre-processing.
#
MM_SPECS = specs.tmp

depend:
	@echo Generating dependencies..
	@copy Makefile.dj Makefile.bak
	@echo "*cpp: %(cpp_cpu) %{posix:-D_POSIX_SOURCE} -remap" > $(MM_SPECS)
	sed -e "/^# DO NOT DELETE THIS LINE/,$$d" < Makefile.bak > Makefile.dj
	echo "# DO NOT DELETE THIS LINE"                        >> Makefile.dj
	$(CC) -MM -specs=$(MM_SPECS) $(CFLAGS) $(SOURCES)       >> Makefile.dj
	@$(RM) -f $(MM_SPECS)

# DO NOT DELETE THIS LINE
_afs.o: _afs.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h afsops.h rx.h kasops.h vlsops.h volops.h ubikops.h rxkops.h \
  ptsops.h
_ah.o: _ah.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_anep.o: _anep.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h
_arp.o: _arp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h ethertyp.h \
  extract.h a2name.h
_ascii.o: _ascii.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h
_atalk.o: _atalk.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ethertyp.h extract.h appletal.h
_atm.o: _atm.c a2name.h ethertyp.h interfac.h target.h pcap/pcap.h \
  pcap/pc-bpf.h
_ax25.o: _ax25.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ip.h
_bgp.o: _bgp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_bootp.o: _bootp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  bootp.h
_bxxp.o: _bxxp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h extract.h
_chdlc.o: _chdlc.c pcap/pcap.h pcap/pc-bpf.h ethertyp.h interfac.h \
  target.h a2name.h ppp.h
_cip.o: _cip.c pcap/pcap.h pcap/pc-bpf.h interfac.h target.h a2name.h
_corba.o: _corba.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h giop.h
_decnet.o: _decnet.c decnet.h extract.h interfac.h target.h pcap/pcap.h \
  pcap/pc-bpf.h a2name.h
_dhcp6.o: _dhcp6.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  dhcp6.h dhcp6opt.h
_domain.o: _domain.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h extract.h
_dvmrp.o: _dvmrp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_egp.o: _egp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ip.h
_esp.o: _esp.c /net/openssl.098/openssl/des.h \
  /net/openssl.098/openssl/e_os2.h /net/openssl.098/openssl/opensslconf.h \
  /net/openssl.098/openssl/des_old.h /net/openssl.098/openssl/symhacks.h \
  /net/openssl.098/openssl/ui_compat.h /net/openssl.098/openssl/ui.h \
  /net/openssl.098/openssl/crypto.h /net/openssl.098/openssl/stack.h \
  /net/openssl.098/openssl/safestack.h \
  /net/openssl.098/openssl/opensslv.h /net/openssl.098/openssl/blowfish.h \
  /net/openssl.098/openssl/rc5.h /net/openssl.098/openssl/cast.h \
  interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h ip.h ip6.h esp.h
_ether.o: _ether.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ethertyp.h
_fddi.o: _fddi.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ethertyp.h fddi.h
_fr.o: _fr.c pcap/pcap.h pcap/pc-bpf.h ethertyp.h interfac.h target.h \
  a2name.h
_frag6.o: _frag6.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_giop.o: _giop.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  giop.h
_giop2.o: _giop2.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_gre.o: _gre.c a2name.h interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  extract.h
_icmp.o: _icmp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h
_icmp6.o: _icmp6.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ip6.h udp.h ah.h icmp6.h
_igrp.o: _igrp.c a2name.h interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  extract.h ip.h igrp.h
_cdp.o: _cdp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h
_cnfp.o: _cnfp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h tcp.h
_stp.o: _stp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h
_iiop.o: _iiop.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_ip.o: _ip.c a2name.h interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  extract.h ip.h
_ip6.o: _ip6.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ip6.h
_ip6opts.o: _ip6opts.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h
_ipcomp.o: _ipcomp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h
_ipx.o: _ipx.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ipx.h extract.h
_isakmp.o: _isakmp.c isakmp.h ipsec_do.h oakley.h interfac.h target.h \
  pcap/pcap.h pcap/pc-bpf.h a2name.h extract.h
_isoclns.o: _isoclns.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h ethertyp.h extract.h
_krb.o: _krb.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_llc.o: _llc.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h smb.h llc.h
_mobile.o: _mobile.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h extract.h
_netbios.o: _netbios.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h netbios.h extract.h
_oncrpc.o: _oncrpc.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h
_lane.o: _lane.c pcap/pcap.h pcap/pc-bpf.h interfac.h target.h a2name.h \
  lane.h
_l2tp.o: _l2tp.c l2tp.h interfac.h target.h pcap/pcap.h pcap/pc-bpf.h
_lcp.o: _lcp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h ppp.h
_nfs.o: _nfs.c pcap/pcap.h pcap/pc-bpf.h interfac.h target.h a2name.h \
  extract.h nfs.h nfsfh.h
_radius.o: _radius.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h extract.h
_ntp.o: _ntp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ntp.h
_null.o: _null.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ip.h ip6.h
_ospf.o: _ospf.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ip.h ospf.h
_ospf6.o: _ospf6.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ospf6.h
_pim.o: _pim.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h
_ppp.o: _ppp.c ethertyp.h interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h ip.h ppp.h
_pppoe.o: _pppoe.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  ppp.h ethertyp.h extract.h
_raw.o: _raw.c a2name.h interfac.h target.h pcap/pcap.h pcap/pc-bpf.h
_rip.o: _rip.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h
_ripng.o: _ripng.c route6d.h interfac.h target.h pcap/pcap.h \
  pcap/pc-bpf.h a2name.h
_rt6.o: _rt6.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_rx.o: _rx.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h rx.h
_sl.o: _sl.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h
_smb.o: _smb.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h smb.h
_snmp.o: _snmp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  mib.h
_srm2.o: _srm2.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h
_sunrpc.o: _sunrpc.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h
_sunrpcr.o: _sunrpcr.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h
_telnet.o: _telnet.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  a2name.h
_tcp.o: _tcp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  extract.h nfs.h smb.h ip.h ip6.h tcp.h
_tftp.o: _tftp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_token.o: _token.c pcap/pcap.h pcap/pc-bpf.h token.h interfac.h target.h \
  a2name.h ethertyp.h llc.h
_udp.o: _udp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h \
  appletal.h nfs.h smb.h bootp.h afsops.h rxkops.h ip.h ip6.h udp.h
_timed.o: _timed.c ip.h udp.h tcp.h interfac.h target.h pcap/pcap.h \
  pcap/pc-bpf.h a2name.h extract.h timed.h
_vjc.o: _vjc.c pcap/pcap.h pcap/pc-bpf.h interfac.h target.h a2name.h
_vrrp.o: _vrrp.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h extract.h \
  a2name.h
_w3mux.o: _w3mux.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_w3ng.o: _w3ng.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_wb.o: _wb.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
_xtp.o: _xtp.c a2name.h interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  xtp.h
a2name.o: a2name.c pcap/pcap.h pcap/pc-bpf.h pcap/pc-name.h ethertyp.h \
  interfac.h target.h llc.h a2name.h
config.o: config.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h a2name.h
etherent.o: etherent.c pcap/pc-name.h
out.o: out.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h
parsenfs.o: parsenfs.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  nfsfh.h
smbutil.o: smbutil.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h smb.h
tcpdump.o: tcpdump.c pcap/pcap.h pcap/pc-bpf.h interfac.h target.h \
  a2name.h ethertyp.h
util.o: util.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h
snprintf.o: snprintf.c
savestr.o: savestr.c interfac.h target.h pcap/pcap.h pcap/pc-bpf.h \
  savestr.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -