1 # Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
2 # The Regents of the University of California. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that: (1) source code distributions
6 # retain the above copyright notice and this paragraph in its entirety, (2)
7 # distributions including binary code include the above copyright notice and
8 # this paragraph in its entirety in the documentation or other materials
9 # provided with the distribution, and (3) all advertising materials mentioning
10 # features or use of this software display the following acknowledgement:
11 # ``This product includes software developed by the University of California,
12 # Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13 # the University nor the names of its contributors may be used to endorse
14 # or promote products derived from this software without specific prior
16 # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 # Various configurable paths (remember to edit Makefile.in, not Makefile)
26 exec_prefix = @
exec_prefix@
27 datarootdir
= @datarootdir@
28 # Pathname of directory to install the binary
30 # Pathname of directory to install the man page
35 top_srcdir
= @top_srcdir@
39 # You shouldn't need to edit anything below here.
48 DEFS
= @DEFS@ @CPPFLAGS@ @V_DEFS@
52 FULL_CFLAGS
= $(CCOPT
) $(DEFS
) $(INCLS
) $(CFLAGS
)
61 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
62 INSTALL_DATA
= @INSTALL_DATA@
65 DEPENDENCY_CFLAG
= @DEPENDENCY_CFLAG@
67 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
68 # Also, gcc does not remove the .o before forking 'as', which can be a
69 # problem if you don't own the file but can write to the directory.
72 $(CC
) $(FULL_CFLAGS
) -c
$(srcdir)/$*.c
74 CSRC
= fptype.c tcpdump.c
190 print-openflow-1.0.c \
191 print-openflow-1.3.c \
240 print-unsupported.c \
258 LOCALSRC
= @LOCALSRC@
261 LIBNETDISSECT_OBJ
=$(LIBNETDISSECT_SRC
:.c
=.o
) ${LOCALSRC
:.c
=.o
} ${LIBOBJS}
262 LIBNETDISSECT
=libnetdissect.a
265 SRC
= $(CSRC
) $(LOCALSRC
)
300 netdissect-stdinc.h \
317 status-exit-codes.h \
320 timeval-operations.h \
325 /usr
/include/netinet
/if_ether.h \
326 /usr
/include/netinet
/in.h
328 TAGFILES
= $(SRC
) $(HDR
) $(TAGHDR
) $(LIBNETDISSECT_SRC
) \
329 print-smb.c smbutil.c
331 CLEANFILES
= $(PROG
) $(OBJ
) $(LIBNETDISSECT_OBJ
)
340 Makefile-devel-adds \
348 cmake
/Modules
/FindCRYPTO.cmake \
349 cmake
/Modules
/FindPCAP.cmake \
350 cmake
/Modules
/FindSMI.cmake \
351 cmake_uninstall.cmake.in \
357 doc
/README.haiku.md \
358 doc
/README.NetBSD.md \
359 doc
/README.solaris.md \
360 doc
/README.Win32.md \
362 instrument-functions.c \
367 missing
/datalinks.c \
369 missing
/getopt_long.c \
370 missing
/getopt_long.h \
371 missing
/getservent.c \
372 missing
/pcap_dump_ftell.c \
385 TEST_DIST
= `git -C "$$DIR" ls-files tests | grep -v 'tests/\..*'`
387 RELEASE_FILES
= $(CSRC
) $(HDR
) $(LIBNETDISSECT_SRC
) $(EXTRA_DIST
) $(TEST_DIST
)
391 $(PROG
): $(OBJ
) @V_PCAPDEP@
$(LIBNETDISSECT
)
393 $(CC
) $(FULL_CFLAGS
) $(LDFLAGS
) -o
$@
$(OBJ
) $(LIBNETDISSECT
) $(LIBS
)
395 instrument_all
: $(PROG
)
396 @
rm -f instrument_functions_global.devel
397 @
rm -f instrument_functions_off.devel
399 instrument_global
: $(PROG
)
400 @touch instrument_functions_global.devel
401 @
rm -f instrument_functions_off.devel
403 instrument_off
: $(PROG
)
404 @touch instrument_functions_off.devel
405 @
rm -f instrument_functions_global.devel
407 $(LIBNETDISSECT
): $(LIBNETDISSECT_OBJ
)
409 $(AR
) cr
$@
$(LIBNETDISSECT_OBJ
)
412 datalinks.o
: $(srcdir)/missing
/datalinks.c
413 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/datalinks.c
414 dlnames.o
: $(srcdir)/missing
/dlnames.c
415 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/dlnames.c
416 getservent.o
: $(srcdir)/missing
/getservent.c
417 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/getservent.c
418 getopt_long.o
: $(srcdir)/missing
/getopt_long.c
419 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/getopt_long.c
420 strdup.o
: $(srcdir)/missing
/strdup.c
421 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strdup.c
422 strlcat.o
: $(srcdir)/missing
/strlcat.c
423 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcat.c
424 strlcpy.o
: $(srcdir)/missing
/strlcpy.c
425 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcpy.c
426 strsep.o
: $(srcdir)/missing
/strsep.c
427 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strsep.c
428 pcap_dump_ftell.o
: $(srcdir)/missing
/pcap_dump_ftell.c
429 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/pcap_dump_ftell.c
432 [ -d
$(DESTDIR
)$(bindir) ] || \
433 (mkdir
-p
$(DESTDIR
)$(bindir); chmod
755 $(DESTDIR
)$(bindir))
434 $(INSTALL_PROGRAM
) $(PROG
) $(DESTDIR
)$(bindir)/$(PROG
)
435 $(INSTALL_PROGRAM
) $(PROG
) $(DESTDIR
)$(bindir)/$(PROG
).
`cat ${srcdir}/VERSION`
436 [ -d
$(DESTDIR
)$(mandir)/man1
] || \
437 (mkdir
-p
$(DESTDIR
)$(mandir)/man1
; chmod
755 $(DESTDIR
)$(mandir)/man1
)
438 $(INSTALL_DATA
) $(PROG
).1 $(DESTDIR
)$(mandir)/man1
/$(PROG
).1
441 rm -f
$(DESTDIR
)$(bindir)/$(PROG
)
442 rm -f
$(DESTDIR
)$(bindir)/$(PROG
).
`cat ${srcdir}/VERSION`
443 rm -f
$(DESTDIR
)$(mandir)/man1
/$(PROG
).1
446 lint
-hbxn
$(SRC
) $(LIBNETDISSECT_SRC
) | \
447 grep
-v
'struct/union .* never defined' | \
448 grep
-v
'possible pointer alignment problem'
451 rm -f
$(CLEANFILES
) $(PROG
)-`cat ${srcdir}/VERSION`.
tar.gz \
452 config.h.in~ configure~ configure.ac~
455 rm -f Makefile config.cache config.log config.status \
456 config.h os-proto.h stamp-h stamp-h.in
$(PROG
).1 \
457 libnetdissect.a tests
/.failed tests
/.passed \
458 tests
/failure-outputs.txt
459 rm -rf autom4te.cache tests
/DIFF tests
/NEW
462 $(srcdir)/tests
/TESTrun
468 ctags
-wtd
$(TAGFILES
)
474 # Use git archive piped to tar to construct a subdirectory whose name
475 # is tcpdump-{release}, containing all the checked-in source files,
476 # and then run autoreconf in that directory to generate the configure
477 # script and other files from that source. Then remove autom4te.cache,
478 # construct the release tarball from that subdirectory, and remove
481 # The --format=tar is to force git archive to write a non-compressed
482 # archive, in case the platform's tar command doesn't have built-in
485 # The ^{tree} is there to force git archive not to write out the
486 # "helpful" global extended pax header with a commit ID, as not all
487 # versions of tar can handle that (Solaris tar can't, for example).
488 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
489 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
490 # ID associated with them, the tree associated with them doesn't have
491 # a commit ID, so no commit ID is available to write, and thus
492 # git archive doesn't write one.)
495 @TAG
=$(PROG
)-`cat VERSION` && \
496 if
[ ! -d .git
]; then echo
'Not in a git clone, stop.'; exit
1; fi
&& \
497 TMPTESTFILE
=`mktemp -t tmptestfile_XXXXXXXX` && \
498 rm -f
"$$TMPTESTFILE" && \
499 AUTORECONF_DIR
=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_
$$$$ && \
501 rm -rf
"$$AUTORECONF_DIR" && \
502 mkdir
"$$AUTORECONF_DIR" && \
503 cd
"$$AUTORECONF_DIR" && \
504 if git
-C
"$$DIR" show-ref
--tags --quiet
--verify
-- "refs/tags/$$TAG"; then \
505 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES
) | \
507 echo
"Archive build from tag $$TAG."; \
509 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES
) | \
511 echo
"No $$TAG tag. Archive build from HEAD."; \
513 (cd
"$$TAG" && "$${AUTORECONF:-autoreconf}" && rm -rf autom4te.cache
) && \
514 tar cf
"$$DIR/$$TAG".
tar "$$TAG" && \
515 rm -f
"$$DIR/$$TAG".
tar.gz
&& \
516 gzip
--best
"$$DIR/$$TAG".
tar && \
518 rm -rf
"$$AUTORECONF_DIR"
520 releasecheck
: releasetar
521 @TAG
=$(PROG
)-`cat VERSION` && \
522 INSTALL_DIR
=/tmp
/install_
"$$TAG"_
$$$$ && \
526 rm -rf
"$$INSTALL_DIR" && \
527 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
529 echo
"[$@] $$ ./configure --enable-smb --quiet --prefix=$$INSTALL_DIR" && \
530 .
/configure
--enable-smb
--quiet
--prefix="$$INSTALL_DIR" && \
531 echo
'[$@] $$ make -s all check' && \
532 make
-s
all check >/dev
/null
&& \
533 echo
'[$@] $$ make -s install' && \
537 rm -rf
"$$INSTALL_DIR" && \
538 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
542 echo
'[$@] $$ cmake -DENABLE_SMB=yes [...] ..' && \
543 cmake
-DENABLE_SMB
=yes \
544 -DCMAKE_INSTALL_PREFIX
="$$INSTALL_DIR" \
545 -DCMAKE_MESSAGE_LOG_LEVEL
=NOTICE \
546 -DCMAKE_RULE_MESSAGES
=OFF \
547 -DCMAKE_INSTALL_MESSAGE
=NEVER \
549 echo
'[$@] $$ make -s all check' && \
550 make
-s
all check >/dev
/null
&& \
551 echo
'[$@] $$ make -s install' && \
555 rm -rf
"$$INSTALL_DIR" && \
559 @
# trailing space(s)?
560 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-v
'^tests/'); then \
561 echo
'Error: Trailing space(s).'; \
565 @
# install-sh has a tab at the end of one line
566 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-vE
'^(tests/|install-sh$$)'); then \
567 echo
'Error: Trailing tabs(s).'; \
575 $(MKDEP
) -c
"$(CC)" -m
"$(DEPENDENCY_CFLAG)" -s
"$(srcdir)" $(DEFS
) $(INCLS
) $(SRC
) $(LIBNETDISSECT_SRC
)
578 shellcheck
-f gcc
-e SC2006 build.sh build_matrix.sh build_common.sh