##  This file is meant to be the central Makefile that configure works with
##  and that all other Makefiles include.  No Makefile other than this one
##  should have to be a configure substitution target.
##
##  For installation paths, see the bottom of this file.

##  This version information is used to generate include/inn/version.h and is
##  used by INN for banner and local version identification.  The version
##  identification string will be "$VERSION ($VERSION_EXTRA)", with the
##  parentheses omitted if $VERSION_EXTRA is empty (as it is for final
##  releases).
##  If you make extensive local modifications to INN, you can put your own
##  version information in $VERSION_EXTRA.  If it's set to "prerelease", the
##  build time will be automatically included, unless you're building from a
##  Git repository, in which case the time of the last modification of the
##  source code will be included.
##      If you modify these two strings, you must encode them in UTF-8
##      (using only US-ASCII characters is consequently also fine) and
##      keep their length reasonable; otherwise, your news server will not
##      be complying with the NNTP protocol.

VERSION		= 2.8.0
VERSION_EXTRA	= 20260501 snapshot

##  The absolute path to the top of the build directory, used to find the
##  libraries built as part of INN.  Using relative paths confuses libtool
##  when linking the test suite.

abs_builddir	= @abs_builddir@

##  Basic compiler settings.  COPT is the variable to override on the make
##  command line to change the optimization or add warning flags (such as
##  -Wall).  All of INN is built with the large file support flags if provided.

CC		= @CC@
COPT		= @CFLAGS@
GCFLAGS		= $(COPT) -I$(top)/include @CPPFLAGS@

LDFLAGS		= @LDFLAGS@
LIBS		= @LIBS@

PROF		= -pg
PROFSUFFIX	= _p
MAKEPROFILING	= $(MAKE) COPT="$(COPT) $(PROF)" \
			  LDFLAGS="$(LDFLAGS) $(PROF)" \
			  LIBSUFFIX=$(PROFSUFFIX)

##  Used to support non-recursive make.  This variable is set to the necessary
##  options to the compiler to create an object file in a subdirectory.  It
##  should be used instead of -c -o $@ $< and may be replaced with code that
##  calls mv, if the compiler doesn't support -c with -o.

CCOUTPUT	= @CCOUTPUT@

##  Warnings to use when building INN with "make warnings"

WARNINGS	= @CC_WARNINGS@

##  libtool support.  Note that INN does not use Automake (and that
##  retrofitting Automake is likely more work than it's worth), so
##  libtool-aware rules have to be written by hand.

LIBTOOL		= @LIBTOOL@
LIBTOOLCC	= @LIBTOOLCC@
LIBTOOLINST	= @LIBTOOLINST@
LIBTOOLLD	= @LIBTOOLLD@
LIBTOOLLDDEPS	= @LIBTOOLLDDEPS@
EXTOBJ		= @EXTOBJ@
EXTLIB		= @EXTLIB@

LIBCC		= $(LIBTOOLCC) $(CC)
LIBLD		= $(LIBTOOLLD) $(CC)
LIBLDDEPS	= $(LIBTOOLLDDEPS) $(CC)

##  zlib support.  Additional flags and libraries used when compiling or
##  linking code that contains compression support.

ZLIB_CPPFLAGS	= @ZLIB_CPPFLAGS@
ZLIB_LDFLAGS	= @ZLIB_LDFLAGS@
ZLIB_LIBS	= @ZLIB_LIBS@

##  Berkeley DB support.  If this support is configured, anything linking
##  against libinnstorage also needs to link against BDB_LDFLAGS and BDB_LIBS.

BDB_CPPFLAGS   = @BDB_CPPFLAGS@ $(ZLIB_CPPFLAGS)
BDB_LDFLAGS    = @BDB_LDFLAGS@ $(ZLIB_LDFLAGS)
BDB_LIBS       = @BDB_LIBS@ $(ZLIB_LIBS)

##  SQLite support.  Additional flags and libraries used when compiling or
##  linking code that contains SQLite support.

SQLITE3_CPPFLAGS = @SQLITE3_CPPFLAGS@
SQLITE3_LDFLAGS  = @SQLITE3_LDFLAGS@
SQLITE3_LIBS     = @SQLITE3_LIBS@

##  INN libraries.  Nearly all INN programs are linked with libinn, and any
##  INN program that reads from or writes to article storage or overview is
##  linked against libinnstorage.  STORAGE_LIBS is for external libraries
##  needed by libinnstorage.

LIBINN		= $(abs_builddir)/lib/libinn$(LIBSUFFIX).$(EXTLIB)
LIBHIST		= $(abs_builddir)/history/libinnhist$(LIBSUFFIX).$(EXTLIB)
LIBSTORAGE	= $(abs_builddir)/storage/libinnstorage$(LIBSUFFIX).$(EXTLIB)
STORAGE_LIBS	= $(BDB_LDFLAGS) $(BDB_LIBS)

DBM_CPPFLAGS	= @DBM_CPPFLAGS@
DBM_LIBS	= @DBM_LIBS@

CRYPT_LIBS	= @CRYPT_LIBS@
PAM_LIBS	= @PAM_LIBS@
REGEX_LIBS	= @REGEX_LIBS@
SHADOW_LIBS	= @SHADOW_LIBS@

##  Embedding support.  Additional flags and libraries used when compiling
##  or linking portions of INN that support embedded interpreters, set by
##  configure based on what interpreter embeddings are selected.

PERL_CPPFLAGS	= @PERL_CPPFLAGS@
PERL_LIBS	= $(abs_builddir)/lib/perl$(LIBSUFFIX).o @PERL_LIBS@

PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
PYTHON_LIBS	= @PYTHON_LIBS@

##  OpenSSL support.  Additional flags and libraries used when compiling or
##  linking code that contains OpenSSL support, and the path to the OpenSSL
##  binaries.

SSL_CPPFLAGS	= @OPENSSL_CPPFLAGS@
SSL_LDFLAGS	= @OPENSSL_LDFLAGS@
SSL_LIBS	= @OPENSSL_LIBS@
CRYPTO_LIBS	= @CRYPTO_LIBS@

SSLBIN		= @SSLBIN@

##  SASL support.  Additional flags and libraries used when compiling or
##  linking code that contains SASL support.

SASL_CPPFLAGS	= @SASL_CPPFLAGS@
SASL_LDFLAGS	= @SASL_LDFLAGS@
SASL_LIBS	= @SASL_LIBS@

##  Kerberos support.  Additional flags and libraries used when compiling or
##  linking code that contains Kerberos support.  If Kerberos libraries were
##  compiled, KRB5_AUTH is also set to the name of the Kerberos v5
##  authenticator that should be compiled and installed.

KRB5_AUTH	= @KRB5_AUTH@
KRB5_CPPFLAGS	= @KRB5_CPPFLAGS@
KRB5_LDFLAGS	= @KRB5_LDFLAGS@
KRB5_LIBS	= @KRB5_LIBS@

##  Systemd support.  Additional flags and libraries used when compiling or
##  linking code that contains systemd support.

SYSTEMD_CFLAGS	= @SYSTEMD_CFLAGS@
SYSTEMD_LIBS	= @SYSTEMD_LIBS@

##  libcanlock support.  Additional flags and libraries used when compiling or
##  linking code that contains Cancel-Lock support.

CANLOCK_CPPFLAGS= @CANLOCK_CPPFLAGS@
CANLOCK_LDFLAGS	= @CANLOCK_LDFLAGS@
CANLOCK_LIBS	= $(abs_builddir)/lib/canlock$(LIBSUFFIX).o @CANLOCK_LIBS@

##  blocklistd support.  Additional flags and libraries needed to add support
##  for FreeBSD's and NetBSD's blocklistd daemon.

BLOCKLIST_CPPFLAGS	= @BLOCKLIST_CPPFLAGS@
BLOCKLIST_LDFLAGS	= @BLOCKLIST_LDFLAGS@
BLOCKLIST_LIBS		= @BLOCKLIST_LIBS@

##  Missing functions.  If non-empty, configure detected that your system
##  was missing some standard functions, and INN will be providing its own
##  replacements from the lib directory.

LIBOBJS		= @LIBOBJS@

##  Paths to various standard programs used during the build process.
##  Changes to this file will *not* be reflected in the paths compiled into
##  programs; these paths are only used during the build process and for
##  some autogenerated scripts.  To change the compiled paths, see
##  include/inn/paths.h.  You may also need to modify scripts/innshellvars*.

AWK		= @AWK@
BZIP2		= @BZIP2@
COMPRESS	= @COMPRESS@
GZIP		= @GZIP@
LEX		= @LEX@
LN_S		= @LN_S@
MKDIR_P		= @MKDIR_P@
PERL		= @PERL@
RANLIB		= @RANLIB@
SED		= @SED@
SHELL		= @SHELL@
UNCOMPRESS	= @UNCOMPRESS@
YACC		= @YACC@

FIXCONFIG	= $(top)/support/fixconfig
FIXSCRIPT	= $(top)/support/fixscript

PERLWHOAMI	= $(PERL) -e 'print scalar getpwuid($$>), "\n"'
WHOAMI		= (whoami || /usr/ucb/whoami || $(PERLWHOAMI)) 2> /dev/null

##  Paths and command lines for programs used only by the maintainers to
##  regenerate dependencies, documentation, and the like.

MAKEDEPEND	= $(SHELL) $(top)/support/makedepend

POD2MAN		= pod2man @POD2TEXT_OPTION@ -c 'InterNetNews Documentation' -r 'INN $(VERSION)'
POD2TEXT	= pod2text @POD2TEXT_OPTION@ -s -l

##  Installation directories.  If any of the below are incorrect, don't just
##  edit this file; these directories are substituted in all over the source
##  tree by configure.  Instead, re-run configure with the correct
##  command-line flags to set the directories.  Run configure --help for a
##  list of supported flags.

prefix		= @prefix@
exec_prefix	= @exec_prefix@
datarootdir	= @datarootdir@
bindir		= @bindir@
docdir		= @docdir@
includedir	= @includedir@
libdir		= @libdir@
mandir		= @mandir@
sysconfdir	= @sysconfdir@
tmpdir		= @tmpdir@

PATHNEWS	= $(prefix)
PATHBIN		= $(bindir)
PATHDATASHARE	= $(datarootdir)
PATHDOC		= $(docdir)
PATHETC		= $(sysconfdir)
PATHMAN		= $(mandir)
PATHINCLUDE	= $(includedir)
PATHLIB		= $(libdir)
PATHLIBPERL	= @LIBPERLDIR@
PATHCONTROL	= @CONTROLDIR@
PATHFILTER	= @FILTERDIR@
PATHRUN		= @RUNDIR@
PATHHTTP	= @HTTPDIR@
PATHLOG		= @LOGDIR@
PATHLOGOLD	= $(PATHLOG)/OLD
PATHDB		= @DBDIR@
PATHSPOOL	= @SPOOLDIR@
PATHTMP		= $(tmpdir)
PATHAUTH	= $(PATHBIN)/auth
PATHAUTHRESOLV	= $(PATHAUTH)/resolv
PATHAUTHPASSWD	= $(PATHAUTH)/passwd
PATHRNEWS	= $(PATHBIN)/rnews.libexec
PATHARCHIVE	= $(PATHSPOOL)/archive
PATHARTICLES	= $(PATHSPOOL)/articles
PATHINCOMING	= $(PATHSPOOL)/incoming
PATHTAPE	= $(PATHSPOOL)/innfeed
PATHINBAD	= $(PATHINCOMING)/bad
PATHOVERVIEW	= $(PATHSPOOL)/overview
PATHOUTGOING	= $(PATHSPOOL)/outgoing

MAN1		= $(mandir)/man1
MAN3		= $(mandir)/man3
MAN3PM		= $(mandir)/man3
MAN5		= $(mandir)/man5
MAN8		= $(mandir)/man8

##  Extension used for Perl modules man pages (for instance "INN::Config.3pm"
##  if MAN3PM_EXT is set to "3pm").

MAN3PM_EXT	= 3pm

##  Installation settings.  The file installation modes are determined by
##  configure; inews and rnews are special and have configure flags to
##  control how they're installed.  See INSTALL for more information.

RUNASUSER	= @RUNASUSER@
RUNASGROUP	= @RUNASGROUP@
RNEWSGROUP	= @RNEWSGRP@

INEWSMODE	= @INEWSMODE@
RNEWSMODE	= @RNEWSMODE@
FILEMODE	= @FILEMODE@

OWNER		= -o $(RUNASUSER) -g $(RUNASGROUP)
ROWNER		= -o $(RUNASUSER) -g $(RNEWSGROUP)

INSTALL		= $(top)/support/install-sh -p

##  Installation commands.  These commands are used by the installation
##  rules of each separate subdirectory.  The naming scheme is as follows:
##  the first two characters are CP (indicating a plain copy) or LI
##  (indicating an installation that goes through libtool).  After an
##  underscore is a one-character indicator of the file type (R for a
##  regular file, X for an executable, S for a setuid root executable, L for
##  a shared library) and then PUB for a world-readable/world-executable
##  file or PRI for a group-readable/ group-executable file (only the news
##  group).
##
##  Man pages should not be backed up with an .OLD extension since it causes
##  man to complain about bogus filenames in MANPATH.  Shared libraries
##  should not be backed up with an .OLD extension since ldconfig will
##  select the .OLD version in preference to the regular version.  We use
##  shared library versioning to allow recovery from make update for shared
##  libraries.
##
##  inews and rnews have their own special installation rules, as do database
##  files like active and newsgroups that should have the same permissions as
##  article files.

BACKUP_OPTION	= -S .OLD

LI_SPRI		= $(LIBTOOLINST) $(INSTALL) -o root -g $(RUNASGROUP) -m 4550 $(BACKUP_OPTION)
LI_XPRI		= $(LIBTOOLINST) $(INSTALL) $(OWNER) -m 0550 $(BACKUP_OPTION)
LI_XPUB		= $(LIBTOOLINST) $(INSTALL) $(OWNER) -m 0555 $(BACKUP_OPTION)
LI_LPUB		= $(LIBTOOLINST) $(INSTALL) $(OWNER) -m 0555

LI_INEWS	= $(LIBTOOLINST) $(INSTALL) $(OWNER) -m $(INEWSMODE) $(BACKUP_OPTION)
LI_RNEWS	= $(LIBTOOLINST) $(INSTALL) $(ROWNER) -m $(RNEWSMODE) $(BACKUP_OPTION)

CP_RPRI		= $(INSTALL) $(OWNER) -m 0640 $(BACKUP_OPTION)
CP_RPUB		= $(INSTALL) $(OWNER) -m 0644 $(BACKUP_OPTION)
CP_XPRI		= $(INSTALL) $(OWNER) -m 0550 $(BACKUP_OPTION)
CP_XPUB		= $(INSTALL) $(OWNER) -m 0555 $(BACKUP_OPTION)
CP_WXPUB	= $(INSTALL) $(OWNER) -m 0755 $(BACKUP_OPTION)

CP_DATA		= $(INSTALL) $(OWNER) -m $(FILEMODE) $(BACKUP_OPTION)
CP_MAN		= $(INSTALL) $(OWNER) -m 0444

##  Some additional definitions needed by some versions of make, to ensure a
##  consistent set of variables are available.

@SET_MAKE@

##  Local variables:
##  mode: makefile
##  End:
