1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
--- Makefile.orig 1993-04-22 14:40:24.000000000 -0700
+++ Makefile 2014-05-29 22:43:08.670436162 -0700
@@ -21,17 +21,16 @@
# @(#) $Header: /usr/staff/martinh/tcpview/RCS/Makefile,v 1.3 1992/11/17 21:59:47 martinh Exp martinh $ (UW)
# Possible Options:
-# -DCSLIP include support for kernel slip interface
+# -UCSLIP include support for kernel slip interface
# -DPPP include support for point to point protocol
# -DIBMRTPC enable the MERIT additions to the Stanford Enetfilter
# -DNOVFPRINTF simulate vfprintf() on systems that don't have it
#
# CSLIP and PPP work only under BPF.
#
-DEFINES =
-CCOPT = -O2
-INCLUDES = -I..
-LIB =
+DEFINES = -UCSLIP -DPPP
+INCLUDES = -I.. -I$(LOCALBASE)/include
+LIB =-ll
# These are for the Sun4 version
#CCOPT = -O2 -Bstatic
@@ -41,20 +40,20 @@
XLIB= -lXm -lXt -lX11
# The installed binary is owned by this group.
-GROUP = staff
+GROUP = wheel
# Full pathname of where to install the binaries
-BINDEST = /usr/local/bin
-TCPSLICE_BINDEST = /usr/local/bin
+BINDEST = $(PREFIX)/bin
+TCPSLICE_BINDEST = $(PREFIX)/bin #unused (FreeBSD port)
# Full pathname of where to install tcpview support files
-TCPVIEW_DIR = /usr/local/tcpview
-FILTER_DIR = /usr/local/tcpview/filters
+TCPVIEW_DIR = $(PREFIX)/lib/tcpview
+FILTER_DIR = $(PREFIX)/lib/tcpview/filters
# Full pathname of where to install the manual entries
-TCPDUMP_MANDEST = /usr/man/manl/tcpdump.l
-TCPVIEW_MANDEST = /usr/man/manl/tcpview.l
-TCPSLICE_MANDEST = /usr/man/manl/tcpslice.l
+TCPDUMP_MANDEST = $(PREFIX)/man/man1/tcpdump.1
+TCPVIEW_MANDEST = $(PREFIX)/man/man1/tcpview.1
+TCPSLICE_MANDEST = $(PREFIX)/man/man1/tcpslice.1
# Standard CFLAGS
STANDARD_CFLAGS = $(CCOPT) $(DEFINES) $(INCLUDES)
@@ -70,7 +69,7 @@
#tahoe-bsd#CFLAGS = $(STANDARD_CFLAGS)
#vax-bsd#CFLAGS = $(STANDARD_CFLAGS)
#vax-ultrix#
-CFLAGS = $(STANDARD_CFLAGS)
+CFLAGS += $(STANDARD_CFLAGS)
#mips-irix#CFLAGS = $(STANDARD_CFLAGS) -D_BSD_COMPAT
SUBDIRS = hp300-bsd mips-ultrix sun?-sunos? sun4-bsd tahoe-bsd vax-bsd \
@@ -92,7 +91,8 @@
# Also, gcc does not remove the .o before forking 'as', which can be a
# problem if you don't own the file but can write to the directory.
.c.o:
- rm -f $@; $(CC) $(CFLAGS) -c $*.c
+# rm -f $@; $(CC) $(CFLAGS) -c $*.c
+ $(CC) $(CFLAGS) -c $*.c
# List all C source files here
@@ -189,7 +189,7 @@
$(CC) $(CFLAGS) -o $@ $(TCPDUMP_OBJ) $(LIB)
tcpview: $(TCPVIEW_OBJ)
- $(CC) $(CFLAGS) -o $@ $(TCPVIEW_OBJ) $(XLIB) $(LIB)
+ $(CC) $(CFLAGS) -o $@ $(TCPVIEW_OBJ) -L${LOCALBASE}/lib $(XLIB) $(LIB)
tcpslice: $(TCPSLICE_OBJ)
$(CC) $(CFLAGS) -o $@ $(TCPSLICE_OBJ)
@@ -209,12 +209,12 @@
-@dir=$(MD)-$(OS)-tcpdump; \
if [ ! -d $$dir ]; then ${MAKE} ${MFLAGS} config1; fi; \
set -x; \
- cd $$dir; ${MAKE} ${MFLAGS} tcpdump; ${MAKE} ${MFLAGS} tcpslice
+ ${MAKE} -C $$dir ${MFLAGS} tcpdump tcpslice
-@dir=$(MD)-$(OS)-tcpview; \
if [ ! -d $$dir ]; then ${MAKE} ${MFLAGS} config2; fi; \
set -x; \
- cd $$dir; ${MAKE} ${MFLAGS} DEFINES="${DEFINES} -DTCPVIEW" tcpview; \
- ${MAKE} ${MFLAGS} FILTERS
+ ${MAKE} -C $$dir ${MFLAGS} DEFINES="${DEFINES} -DTCPVIEW" tcpview; \
+ ${MAKE} -C $$dir ${MFLAGS} FILTERS
# N.B.- symbolic links are used in the subdirectory rather than VPATH
# because at least one Sun cc compiler puts the .o in the wrong place
@@ -239,7 +239,7 @@
ln -s ../net $$dir/net; \
sed -e "/^all:/d" -e "s/^#$$dir#//" Makefile >$$dir/Makefile; \
chmod ug+w $$dir/Makefile; \
- cd $$dir ; ${MAKE} ${MFLAGS} depend1
+ ${MAKE} -C $$dir ${MFLAGS} depend1
config2:
-@md=$(MD); os=$(OS); dir=$$md-$$os-tcpview; list=; \
@@ -258,23 +258,24 @@
ln -s ../TCPVIEW_VERSION $$dir/TCPVIEW_VERSION; \
sed -e "/^all:/d" -e "s/^#$$dir#//" Makefile >$$dir/Makefile; \
chmod ug+w $$dir/Makefile; \
- cd $$dir ; ${MAKE} ${MFLAGS} depend2
+ ${MAKE} -C $$dir ${MFLAGS} depend2
tcplex.c: tcplex.l
- rm -f $@
+# rm -f $@
$(LEX) $<
mv -f lex.yy.c tcplex.c
tokdefs.h: tcpgram.c
tcpgram.c: tcpgram.y
- rm -f tcpgram.c tokdefs.h
+# rm -f tcpgram.c tokdefs.h
$(YACC) -d $<
mv y.tab.c tcpgram.c
mv y.tab.h tokdefs.h
version.o: version.c
version.c version.h: VERSION TCPVIEW_VERSION
- rm -f version.c ; sed 's/.*/char version[] = "&";/' VERSION > version.c
+# rm -f version.c ;
+ sed 's/.*/char version[] = "&";/' VERSION > version.c
sed 's/.*/char tcpview_version[] = "&";/' TCPVIEW_VERSION >> version.c
set `sed 's/\([0-9]*\)\.\([0-9]*\).*/\1 \2/' VERSION` ; \
{ echo '#define VERSION_MAJOR' $$1 ; \
@@ -287,22 +288,20 @@
install: force
-mkdir -p $(TCPVIEW_DIR)
-mkdir -p $(FILTER_DIR)
- @dir=$(MD)-$(OS)-tcpdump; set -x; \
- cd $$dir ; \
- install -m 755 -g $(GROUP) tcpdump $(DESTDIR)$(BINDEST); \
- install -m 755 tcpslice $(DESTDIR)$(TCPSLICE_BINDEST)
+# @dir=$(MD)-$(OS)-tcpdump; set -x; \
+# cd $$dir ; \
+# install -m 755 -g $(GROUP) -c tcpdump $(DESTDIR)$(BINDEST); \
+# install -m 755 -c tcpslice $(DESTDIR)$(TCPSLICE_BINDEST)
@dir=$(MD)-$(OS)-tcpview; set -x; \
- cd $$dir ; \
- install -m 755 -g $(GROUP) tcpview $(DESTDIR)$(BINDEST); \
- install -m 755 -g $(GROUP) BGP $(FILTER_DIR); \
- install -m 755 -g $(GROUP) telnet $(FILTER_DIR); \
- install -m 755 -g $(GROUP) generic $(FILTER_DIR); \
- cd ../DOC ; \
- install -m 666 -c hosts $(TCPVIEW_DIR); \
- install -m 666 -c manuf $(TCPVIEW_DIR); \
- install -c tcpdump.1 $(DESTDIR)$(TCPDUMP_MANDEST); \
- install -c tcpview.1 $(DESTDIR)$(TCPVIEW_MANDEST); \
- install -c tcpslice.1 $(DESTDIR)$(TCPSLICE_MANDEST)
+ ${BSD_INSTALL_PROGRAM} -c $$dir/tcpview $(BINDEST); \
+ ${BSD_INSTALL_PROGRAM} -c $$dir/BGP $(FILTER_DIR); \
+ ${BSD_INSTALL_PROGRAM} -c $$dir/telnet $(FILTER_DIR); \
+ ${BSD_INSTALL_PROGRAM} -c $$dir/generic $(FILTER_DIR); \
+ ${BSD_INSTALL_DATA} -c $$dir/../DOC/hosts $(TCPVIEW_DIR); \
+ ${BSD_INSTALL_DATA} -c $$dir/../DOC/manuf $(TCPVIEW_DIR); \
+ ${BSD_INSTALL_MAN} -c $$dir/../DOC/tcpview.1 $(TCPVIEW_MANDEST); \
+# install -m 444 -c tcpdump.1 $(DESTDIR)$(TCPDUMP_MANDEST); \
+# install -m 444 -c tcpslice.1 $(DESTDIR)$(TCPSLICE_MANDEST)
lint: force
lint -hbxn $(CSRC) | \
@@ -367,8 +366,3 @@
-../mkdep $(DEFINES) $(INCLUDES) $(TCPVIEW_CSRC) \
tcpgram.c tcplex.c
rm -f $(GEN)
-
-
-
-
-
|