# common Makefile lines for the Distributed Checksum Clearinghouse programs

# These rules must be included after the share BSD mk files so that
# the shared files can be happy about defining the main targets

# Copyright (c) 2008 by Rhyolite Software, LLC
#
# This agreement is not applicable to any entity which sells anti-spam
# solutions to others or provides an anti-spam solution as part of a
# security solution sold to other entities, or to a private network
# which employs the DCC or uses data provided by operation of the DCC
# but does not provide corresponding data to other users.
#
# Permission to use, copy, modify, and distribute this software without
# changes for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this permission notice appear in all
# copies and any distributed versions or copies are either unchanged
# or not called anything similar to "DCC" or "Distributed Checksum
# Clearinghouse".
#
# Parties not eligible to receive a license under this agreement can
# obtain a commercial license to use DCC by contacting Rhyolite Software
# at sales@rhyolite.com.
#
# A commercial license would be for Distributed Checksum and Reputation
# Clearinghouse software.  That software includes additional features.  This
# free license for Distributed ChecksumClearinghouse Software does not in any
# way grant permision to use Distributed Checksum and Reputation Clearinghouse
# software
#
# THE SOFTWARE IS PROVIDED "AS IS" AND RHYOLITE SOFTWARE, LLC DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RHYOLITE SOFTWARE, LLC
# BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.

# Rhyolite Software DCC 1.3.103-1.41 $Revision$
# @configure_input@

# some versions of gmake do not understand ?=
@MAKE_DOT@ifndef INSTALL
INSTALL	=@DCCINSTALL@
@MAKE_DOT@endif

BININSTALL=$(INSTALL) -c $(SET_BINOWN) -m $(BINMODE)

# create the DCC home directory before trying to install files
beforeinstall:$(BINDIR) $(MANDIR)8 depend all
$(BINDIR):
	$(INSTALL) -d $(SET_BINOWN) -m 755 $@

@USE_DCCMANINSTALL@
dccmaninstall:
@MAKE_DOT@ifndef NOMAN
@MAKE_DOT@ifdef MAN8
	eval 'for NM in $(MAN8); do\
	  $(INSTALL) -c $(SET_MANOWN) -m $(MANMODE) $$NM $(MANDIR)8@MAN8INST@;\
	  done'
@MAKE_DOT@endif
@MAKE_DOT@endif

$(MANDIR)8:
@MAKE_DOT@ifndef NOMAN
@MAKE_DOT@ifdef MAN8
	$(INSTALL) -d $(SET_MANOWN) -m 755 $(MANDIR)8
@MAKE_DOT@endif
@MAKE_DOT@endif


uninstall delete:deinstall
deinstall:beforedelete

progdelete:
@MAKE_DOT@ifdef PROG
	rm -f $(BINDIR)/$(PROG)
@MAKE_DOT@endif

beforedelete:progdelete
@MAKE_DOT@ifdef SUBDIR
	for DIR in $(SUBDIR); do\
	    (cd $$DIR; $(MAKE) $(GMAKE_QUIET) deinstall); done
@MAKE_DOT@endif
@MAKE_DOT@ifndef NOMAN
@MAKE_DOT@ifdef MAN8
	eval 'for NM in $(MAN8); do rm -f $(MANDIR)8@MAN8INST@/$$NM; done'
@MAKE_DOT@endif
@MAKE_DOT@endif


# ensure that even systems with neither the BSD nor the gmake dependency
#   mechanisms rebuild things when the main parameter file changes.
@MAKE_DOT@ifdef SRCS
$(SRCS:.c=.o):$(DEPTH)/include/dcc_config.h
# ensure that adding a kludge.h file or otherwise changing included files
#   rebuilds dependencies in systems with .depend files
.depend:$(DEPTH)/include/dcc_config.h Makefile $(DEPTH)/Makefile.inc	\
	    $(DEPTH)/Makefile.inc2
@MAKE_DOT@endif
