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
= $(INCLS
) $(CCOPT
) $(DEFS
) $(CFLAGS
)
61 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
62 INSTALL_DATA
= @INSTALL_DATA@
65 DEPENDENCY_CFLAG
= @DEPENDENCY_CFLAG@
68 $(CC
) $(FULL_CFLAGS
) -c
-o
$@
$<
70 CSRC
= fptype.c tcpdump.c
187 print-openflow-1.0.c \
188 print-openflow-1.3.c \
237 print-unsupported.c \
255 LOCALSRC
= @LOCALSRC@
258 LIBNETDISSECT_OBJ
=$(LIBNETDISSECT_SRC
:.c
=.o
) ${LOCALSRC
:.c
=.o
} ${LIBOBJS}
259 LIBNETDISSECT
=libnetdissect.a
262 SRC
= $(CSRC
) $(LOCALSRC
)
298 netdissect-stdinc.h \
313 status-exit-codes.h \
316 timeval-operations.h \
321 /usr
/include/netinet
/if_ether.h \
322 /usr
/include/netinet
/in.h
324 TAGFILES
= $(SRC
) $(HDR
) $(TAGHDR
) $(LIBNETDISSECT_SRC
) \
325 print-smb.c smbutil.c
327 CLEANFILES
= $(PROG
) $(OBJ
) $(LIBNETDISSECT_OBJ
) \
328 print-smb.o smbutil.o instrument-functions.o
337 Makefile-devel-adds \
345 cmake
/Modules
/FindCRYPTO.cmake \
346 cmake
/Modules
/FindPCAP.cmake \
347 cmake
/Modules
/FindSMI.cmake \
348 cmake_uninstall.cmake.in \
354 doc
/README.haiku.md \
355 doc
/README.NetBSD.md \
356 doc
/README.solaris.md \
357 doc
/README.windows.md \
359 instrument-functions.c \
361 missing
/getopt_long.c \
362 missing
/getopt_long.h \
363 missing
/getservent.c \
375 TEST_DIST
= `git -C "$$DIR" ls-files tests`
377 RELEASE_FILES
= $(CSRC
) $(HDR
) $(LIBNETDISSECT_SRC
) $(EXTRA_DIST
) $(TEST_DIST
)
381 $(PROG
): $(OBJ
) @V_PCAPDEP@
$(LIBNETDISSECT
)
383 $(CC
) $(FULL_CFLAGS
) $(LDFLAGS
) -o
$@
$(OBJ
) $(LIBNETDISSECT
) $(LIBS
)
385 $(LIBNETDISSECT
): $(LIBNETDISSECT_OBJ
)
387 $(AR
) cr
$@
$(LIBNETDISSECT_OBJ
)
390 getservent.o
: $(srcdir)/missing
/getservent.c
391 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/getservent.c
392 getopt_long.o
: $(srcdir)/missing
/getopt_long.c
393 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/getopt_long.c
394 strlcat.o
: $(srcdir)/missing
/strlcat.c
395 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcat.c
396 strlcpy.o
: $(srcdir)/missing
/strlcpy.c
397 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcpy.c
398 strsep.o
: $(srcdir)/missing
/strsep.c
399 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strsep.c
402 [ -d
$(DESTDIR
)$(bindir) ] || \
403 (mkdir
-p
$(DESTDIR
)$(bindir); chmod
755 $(DESTDIR
)$(bindir))
404 $(INSTALL_PROGRAM
) $(PROG
) $(DESTDIR
)$(bindir)/$(PROG
)
405 [ ! -f
"${srcdir}/.devel" ] ||
$(INSTALL_PROGRAM
) $(PROG
) $(DESTDIR
)$(bindir)/$(PROG
).
`cat ${srcdir}/VERSION`
406 [ -d
$(DESTDIR
)$(mandir)/man1
] || \
407 (mkdir
-p
$(DESTDIR
)$(mandir)/man1
; chmod
755 $(DESTDIR
)$(mandir)/man1
)
408 $(INSTALL_DATA
) $(PROG
).1 $(DESTDIR
)$(mandir)/man1
/$(PROG
).1
411 rm -f
$(DESTDIR
)$(bindir)/$(PROG
)
412 rm -f
$(DESTDIR
)$(bindir)/$(PROG
).
`cat ${srcdir}/VERSION`
413 rm -f
$(DESTDIR
)$(mandir)/man1
/$(PROG
).1
416 lint
-hbxn
$(SRC
) $(LIBNETDISSECT_SRC
) | \
417 grep
-v
'struct/union .* never defined' | \
418 grep
-v
'possible pointer alignment problem'
421 rm -f
$(CLEANFILES
) $(PROG
)-`cat ${srcdir}/VERSION`.
tar.gz \
422 config.h.in~ configure~ configure.ac~
425 rm -f Makefile config.cache config.log config.status \
426 config.h os-proto.h stamp-h stamp-h.in
$(PROG
).1 \
428 rm -rf autom4te.cache
431 $(srcdir)/tests
/TESTrun
437 ctags
-wtd
$(TAGFILES
)
443 # Use git archive piped to tar to construct a subdirectory whose name
444 # is tcpdump-{release}, containing all the checked-in source files,
445 # and then run autoreconf in that directory to generate the configure
446 # script and other files from that source. Then remove autom4te.cache,
447 # construct the release tarball from that subdirectory, and remove
450 # The --format=tar is to force git archive to write a non-compressed
451 # archive, in case the platform's tar command doesn't have built-in
454 # The ^{tree} is there to force git archive not to write out the
455 # "helpful" global extended pax header with a commit ID, as not all
456 # versions of tar can handle that (Solaris tar can't, for example).
457 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
458 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
459 # ID associated with them, the tree associated with them doesn't have
460 # a commit ID, so no commit ID is available to write, and thus
461 # git archive doesn't write one.)
464 @TAG
=$(PROG
)-`cat VERSION` && \
465 if
[ ! -d .git
]; then echo
'Not in a git clone, stop.'; exit
1; fi
&& \
466 TMPTESTFILE
=`mktemp -t tmptestfile_XXXXXXXX` && \
467 rm -f
"$$TMPTESTFILE" && \
468 AUTORECONF_DIR
=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_
$$$$ && \
470 rm -rf
"$$AUTORECONF_DIR" && \
471 mkdir
"$$AUTORECONF_DIR" && \
472 cd
"$$AUTORECONF_DIR" && \
473 if git
-C
"$$DIR" show-ref
--tags --quiet
--verify
-- "refs/tags/$$TAG"; then \
474 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES
) | \
476 echo
"Archive build from tag $$TAG."; \
478 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES
) | \
480 echo
"No $$TAG tag. Archive build from HEAD."; \
482 (cd
"$$TAG" && .
/autogen.sh
&& rm -rf autom4te.cache
) && \
483 tar cf
"$$DIR/$$TAG".
tar "$$TAG" && \
484 rm -f
"$$DIR/$$TAG".
tar.gz
&& \
485 gzip
--best
"$$DIR/$$TAG".
tar && \
487 rm -rf
"$$AUTORECONF_DIR"
489 releasecheck
: releasetar
490 @TAG
=$(PROG
)-`cat VERSION` && \
491 INSTALL_DIR
=/tmp
/install_
"$$TAG"_
$$$$ && \
495 rm -rf install_libpcap
&& \
496 echo
"[$@] $$ git clone [...] libpcap.git" && \
497 git clone
--depth
3 --quiet https
://github.com
/the-tcpdump-group
/libpcap.git
&& \
498 echo
"[$@] $$ cd libpcap" && \
500 echo
"[$@] $$ ./autogen.sh" && \
502 echo
"[$@] $$ ./configure --quiet --prefix=/tmp/install_libpcap" && \
503 .
/configure
--quiet
--prefix=/tmp
/install_libpcap
&& \
504 echo
"[$@] $$ make -s " && \
506 echo
"[$@] $$ make -s install" && \
508 echo
"[$@] $$ cd .." && \
511 rm -rf
"$$INSTALL_DIR" && \
512 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
514 echo
"[$@] $$ touch .devel" && \
516 echo
"[$@] $$ ./configure --enable-instrument-functions --enable-smb --quiet --prefix=$$INSTALL_DIR" && \
517 .
/configure
--enable-instrument-functions
--enable-smb
--quiet
--prefix="$$INSTALL_DIR" && \
518 echo
'[$@] $$ $(MAKE) -s all check' && \
519 $(MAKE
) -s
all check >/dev
/null
&& \
520 echo
'[$@] $$ $(MAKE) -s install' && \
521 $(MAKE
) -s
install && \
524 rm -rf
"$$INSTALL_DIR" && \
525 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
527 echo
"[$@] $$ touch .devel" && \
531 echo
"[$@] $$ export PKG_CONFIG_PATH=/tmp/install_libpcap/lib/pkgconfig" && \
532 export PKG_CONFIG_PATH
=/tmp
/install_libpcap
/lib
/pkgconfig
&& \
533 echo
'[$@] $$ cmake -DENABLE_SMB=yes [...] ..' && \
534 cmake
-DENABLE_SMB
=yes \
535 -DCMAKE_INSTALL_PREFIX
="$$INSTALL_DIR" \
536 -DCMAKE_MESSAGE_LOG_LEVEL
=NOTICE \
537 -DCMAKE_RULE_MESSAGES
=OFF \
538 -DCMAKE_INSTALL_MESSAGE
=NEVER \
540 echo
'[$@] $$ $(MAKE) -s all check' && \
541 $(MAKE
) -s
all check >/dev
/null
&& \
542 echo
'[$@] $$ $(MAKE) -s install' && \
543 $(MAKE
) -s
install && \
546 rm -rf
"$$INSTALL_DIR" && \
547 rm -rf install_libpcap
&& \
552 @
# trailing space(s)?
553 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-v
'^tests/'); then \
554 echo
'Error: Trailing space(s).'; \
558 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-v
'^tests/'); then \
559 echo
'Error: Trailing tabs(s).'; \
562 @
# space(s) before tab(s)?
563 @if git grep
-I
-n
'[ ][ ]' $$(git ls-files|grep
-v
'^tests/'); then \
564 echo
'Error: space(s) before tab(s).'; \
572 @echo
$(MKDEP
) -c
$(CC
) -m
"$(DEPENDENCY_CFLAG)" -s
"$(srcdir)" $(DEFS
) $(INCLS
) $(SRC
) '<libnetdissect src list>'
573 @
$(MKDEP
) -c
$(CC
) -m
"$(DEPENDENCY_CFLAG)" -s
"$(srcdir)" $(DEFS
) $(INCLS
) $(SRC
) $(LIBNETDISSECT_SRC
)
576 shellcheck
-f gcc
-e SC2006 autogen.sh build.sh build_matrix.sh build_common.sh mkdep .ci-coverity-scan-build.sh