# Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
# The Regents of the University of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that: (1) source code distributions
# retain the above copyright notice and this paragraph in its entirety, (2)
# distributions including binary code include the above copyright notice and
# this paragraph in its entirety in the documentation or other materials
# provided with the distribution, and (3) all advertising materials mentioning
# features or use of this software display the following acknowledgement:
# ``This product includes software developed by the University of California,
# Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
# the University nor the names of its contributors may be used to endorse
# or promote products derived from this software without specific prior
# written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
# Pathname of directory to install the binary
bindir = @bindir@
# Pathname of directory to install the man page
mandir = @mandir@
# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
# 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) $(FULL_CFLAGS) -c $(srcdir)/$*.c
#
# Use git archive piped to tar to construct a subdirectory whose name
# is tcpdump-{release}, containing all the checked-in source files,
# and then run autoreconf in that directory to generate the configure
# script and other files from that source. Then remove autom4te.cache,
# construct the release tarball from that subdirectory, and remove
# the subdirectory.
#
# The --format=tar is to force git archive to write a non-compressed
# archive, in case the platform's tar command doesn't have built-in
# decompression.
#
# The ^{tree} is there to force git archive not to write out the
# "helpful" global extended pax header with a commit ID, as not all
# versions of tar can handle that (Solaris tar can't, for example).
# (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
# into a tree; apparently, unlike HEAD, or a tag, which have a commit
# ID associated with them, the tree associated with them doesn't have
# a commit ID, so no commit ID is available to write, and thus
# git archive doesn't write one.)
#
releasetar:
@TAG=$(PROG)-`cat VERSION` && \
if [ ! -d .git ]; then echo 'Not in a git clone, stop.'; exit 1; fi && \
TMPTESTFILE=`mktemp -t tmptestfile_XXXXXXXX` && \
rm -f "$$TMPTESTFILE" && \
AUTORECONF_DIR=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_$$$$ && \
DIR=`pwd` && \
rm -rf "$$AUTORECONF_DIR" && \
mkdir "$$AUTORECONF_DIR" && \
cd "$$AUTORECONF_DIR" && \
if git -C "$$DIR" show-ref --tags --quiet --verify -- "refs/tags/$$TAG"; then \
(git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES) | \
tar xf -) && \
echo "Archive build from tag $$TAG."; \
else \
(git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES) | \
tar xf -) && \
echo "No $$TAG tag. Archive build from HEAD."; \
fi && \
(cd "$$TAG" && "$${AUTORECONF:-autoreconf}" && rm -rf autom4te.cache) && \
tar cf "$$DIR/$$TAG".tar "$$TAG" && \
rm -f "$$DIR/$$TAG".tar.gz && \
gzip --best "$$DIR/$$TAG".tar && \
cd "$$DIR" && \
rm -rf "$$AUTORECONF_DIR"