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 \
239 print-unsupported.c \
257 LOCALSRC = @LOCALSRC@
260 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
261 LIBNETDISSECT=libnetdissect.a
264 SRC = $(CSRC) $(LOCALSRC)
266 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
267 # hack the extra indirection
301 netdissect-stdinc.h \
318 status-exit-codes.h \
321 timeval-operations.h \
326 /usr/include/netinet/if_ether.h \
327 /usr/include/netinet/in.h
329 TAGFILES = $(SRC) $(HDR) $(TAGHDR) $(LIBNETDISSECT_SRC) \
330 print-smb.c smbutil.c
332 CLEANFILES = $(PROG) $(OBJ) $(LIBNETDISSECT_OBJ) print-smb.o smbutil.o
341 Makefile-devel-adds \
348 cmake/Modules/FindCRYPTO.cmake \
349 cmake/Modules/FindPCAP.cmake \
350 cmake/Modules/FindSMI.cmake \
351 cmake_uninstall.cmake.in \
359 doc/README.NetBSD.md \
360 doc/README.solaris.md \
361 doc/README.Win32.md \
368 missing/datalinks.c \
370 missing/getopt_long.c \
371 missing/getopt_long.h \
372 missing/getservent.c \
373 missing/pcap_dump_ftell.c \
387 TEST_DIST= `git ls-files tests | grep -v 'tests/\..*'`
389 RELEASE_FILES = $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST)
393 $(PROG): $(OBJ) @V_PCAPDEP@ $(LIBNETDISSECT)
395 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBNETDISSECT) $(LIBS)
397 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
399 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
402 datalinks.o: $(srcdir)/missing/datalinks.c
403 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
404 dlnames.o: $(srcdir)/missing/dlnames.c
405 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
406 getservent.o: $(srcdir)/missing/getservent.c
407 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getservent.c
408 getopt_long.o: $(srcdir)/missing/getopt_long.c
409 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
410 snprintf.o: $(srcdir)/missing/snprintf.c
411 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
412 strdup.o: $(srcdir)/missing/strdup.c
413 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strdup.c
414 strlcat.o: $(srcdir)/missing/strlcat.c
415 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
416 strlcpy.o: $(srcdir)/missing/strlcpy.c
417 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
418 strsep.o: $(srcdir)/missing/strsep.c
419 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
420 pcap_dump_ftell.o: $(srcdir)/missing/pcap_dump_ftell.c
421 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/pcap_dump_ftell.c
424 [ -d $(DESTDIR)$(bindir) ] || \
425 (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
426 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG)
427 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
428 [ -d $(DESTDIR)$(mandir)/man1 ] || \
429 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
430 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
433 rm -f $(DESTDIR)$(bindir)/$(PROG)
434 rm -f $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
435 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
438 lint -hbxn $(SRC) $(LIBNETDISSECT_SRC) | \
439 grep -v 'struct/union .* never defined' | \
440 grep -v 'possible pointer alignment problem'
443 rm -f $(CLEANFILES) $(PROG)-`cat ${srcdir}/VERSION`.tar.gz
446 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
447 config.h os-proto.h stamp-h stamp-h.in $(PROG).1 \
448 libnetdissect.a tests/.failed tests/.passed \
449 tests/failure-outputs.txt
450 rm -rf autom4te.cache tests/DIFF tests/NEW
453 $(srcdir)/tests/TESTrun
459 ctags -wtd $(TAGFILES)
465 @TAG=$(PROG)-`cat VERSION` && \
466 if git show-ref --tags --quiet --verify -- "refs/tags/$$TAG"; then \
467 git archive --prefix="$$TAG"/ -o "$$TAG".tar.gz "$$TAG" \
468 $(RELEASE_FILES) && \
469 echo "Archive build from tag $$TAG."; \
471 git archive --prefix="$$TAG"/ -o "$$TAG".tar.gz HEAD \
472 $(RELEASE_FILES) && \
473 echo "No $$TAG tag. Archive build from HEAD."; \
476 releasecheck: releasetar
477 @TAG=$(PROG)-`cat VERSION` && \
478 INSTALL_DIR=/tmp/install_"$$TAG"_$$$$ && \
482 rm -rf "$$INSTALL_DIR" && \
483 tar xf "$$DIR"/"$$TAG".tar.gz && \
485 echo "[$@] $$ ./configure --enable-smb --quiet --prefix=$$INSTALL_DIR" && \
486 ./configure --enable-smb --quiet --prefix="$$INSTALL_DIR" && \
487 echo '[$@] $$ make -s all check' && \
488 make -s all check >/dev/null && \
489 echo '[$@] $$ make -s install' && \
493 rm -rf "$$INSTALL_DIR" && \
494 tar xf "$$DIR"/"$$TAG".tar.gz && \
498 echo '[$@] $$ cmake -DENABLE_SMB=yes [...] ..' && \
499 cmake -DENABLE_SMB=yes \
500 -DCMAKE_INSTALL_PREFIX="$$INSTALL_DIR" \
501 -DCMAKE_MESSAGE_LOG_LEVEL=NOTICE \
502 -DCMAKE_RULE_MESSAGES=OFF \
503 -DCMAKE_INSTALL_MESSAGE=NEVER \
505 echo '[$@] $$ make -s all check' && \
506 make -s all check >/dev/null && \
507 echo '[$@] $$ make -s install' && \
511 rm -rf "$$INSTALL_DIR" && \
515 @# trailing space(s)?
516 @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \
517 echo 'Error: Trailing space(s).'; \
521 @# install-sh has a tab at the end of one line
522 @if git grep -I -n ' $$' $$(git ls-files|grep -vE '^(tests/|install-sh$$)'); then \
523 echo 'Error: Trailing tabs(s).'; \
526 @# space(s) before tab(s)?
527 @if git grep -I -n '[ ][ ]' $$(git ls-files|grep -v '^tests/'); then \
528 echo 'Error: space(s) before tab(s).'; \
536 $(MKDEP) -c "$(CC)" -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) $(LIBNETDISSECT_SRC)
539 shellcheck -f gcc -e SC2006 build.sh build_matrix.sh build_common.sh