# common Makefile lines for the Distributed Checksum Clearinghouse

# 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.61 $Revision$
# @configure_input@

# These lines must not include any rules, or the shared BSD mk files
# will be confused and not do anything.

# BSD/OS bsd.prog.mk includes ../Makefile.inc twice
@MAKE_DOT@ifndef DCC_MAKEFILE_INC
DCC_MAKEFILE_INC=x

# common to all DCC clients
CLNTLIBS    =$(DEPTH)/dcclib/libdcc.a

# common to threaded DCC clients
THRINC	    =-I$(DEPTH)/thrlib @PTHREAD_CFLAGS@
THR_LDADD    =$(DEPTH)/thrlib/libthr.a @PTHREAD_LIBS@
THR_DPADD    =$(DEPTH)/thrlib/libthr.a

SRVRINC	    =-I$(DEPTH)/srvrlib
SRVRLIBS    =$(DEPTH)/srvrlib/libsrvr.a

@DCC_CC@
RANLIB	    =@RANLIB@

NOPROFILE   =		# stop FreeBSD profile library
NO_PROFILE  =
NOGCCERROR  =		#turn off NetBSD's default nonsense in bsd.sys.mk
NOLINT	    =		#why does NetBSD care about lint today?
NO_LINT	    =		#   suppress FreeBSD noise about NOLINT
STRIP	    =		#keep FreeBSD from stripping the a.outs

LDADD	    +=$(CLNTLIBS) @LIBS@
DPADD	    +=$(CLNTLIBS)

#DBGFLAGS   +=-g
#DBGFLAGS   +=-DDCC_DEBUG_HEAP -DDCC_DEBUG_CKSUM -DDCC_DEBUG_CLNT_LOCK
# --with-c-warnings   gcc warnings
@CWRN1@	    +=-W -Wall -Wunused -Winline -Wbad-function-cast
@CWRN1@	    +=-Wnested-externs -Wpointer-arith -Wshadow -Wwrite-strings
# --with-c-warnings=2   often not supported
@CWRN2@	    +=-Wdeclaration-after-statement -Wmissing-noreturn -Wswitch-enum
#  --with-c-warnings=3   often wrong
@CWRN3@	    +=-Wformat-nonliteral -Wunreachable-code -Wcast-align
CFLAGS	    +=@DCC_CFLAGS@ $(DBGFLAGS) $(CWARN) -I$(DEPTH)/include $(PROFILE)
LDFLAGS	    +=@DCC_LDFLAGS@ $(DBGFLAGS) $(PROFILE)

# turn off man pages if not installing on the system
@NO_SYS_INSTALL@
@NO_SUID@

DCC_HOMEDIR =@prefix@
@MAKE_DOT@ifdef DCC_BINDIR
BINDIR	    =$(DCC_BINDIR)
@MAKE_DOT@else
BINDIR	    =@installroot@@bindir@
@MAKE_DOT@endif

@MAKE_DOT@ifndef DCC_OWN
@MAKE_DOT@ifdef NO_SUID
DCC_OWN	    =@DCC_OWN@
@MAKE_DOT@else
DCC_OWN	    =@DCCSUID@
@MAKE_DOT@endif
@MAKE_DOT@endif
BINOWN	    =$(DCC_OWN)

@MAKE_DOT@ifndef DCC_GRP
DCC_GRP	    =@DCC_GRP@
@MAKE_DOT@endif
BINGRP	    =$(DCC_GRP)

@MAKE_DOT@ifndef DCC_MODE
DCC_MODE    =555
@MAKE_DOT@endif
BINMODE	    =$(DCC_MODE)

MANDIR	    =@installroot@@mandir@
@MAKE_DOT@ifndef MANGRP
MANGRP	    =$(DCC_GRP)
@MAKE_DOT@endif
@MAKE_DOT@ifndef MANOWN
MANOWN	    =$(DCC_OWN)
@MAKE_DOT@endif
MANMODE	    =444

@MAKE_DOT@ifdef NO_SYS_INSTALL
NOMAN	=no
SET_BINOWN=
SET_MANOWN=
SET_DCCOWN=
@MAKE_DOT@else
SET_BINOWN=-o $(BINOWN) -g $(BINGRP)
SET_MANOWN=-o $(MANOWN) -g $(MANGRP)
SET_DCCOWN=-o @DCCSUID@ -g $(BINGRP)
@MAKE_DOT@endif

@MAKE_DOT@ifdef PROG
MAN8	=$(PROG).0
# turn off man pages in the command directories and build them in the top level
NOMAN	=no
@MAKE_DOT@endif
@MAKE_DOT@endif

# deal with silly FreeBSD renaming frenzy
@MAKE_DOT@ifdef NOMAN
NO_MAN	=no
@MAKE_DOT@endif
