#
# Common makefile definitions for the IPP sample code.
#
# Copyright © 2014-2018 by the IEEE-ISTO Printer Working Group.
# Copyright © 2007-2018 by Apple Inc.
# Copyright © 1997-2007 by Easy Software Products, all rights reserved.
#
# Licensed under Apache License v2.0.  See the file "LICENSE" for more
# information.
#

#
# Version of the IPP sample code.
#

IPPSAMPLE_VERSION =	@CUPS_VERSION@


#
# Components that get built...
#

IPPFIND_BIN		=	@IPPFIND_BIN@
IPPFIND_HTML		=	@IPPFIND_HTML@
IPPFIND_MAN		=	@IPPFIND_MAN@
IPPTRANSFORM_BIN	=	@IPPTRANSFORM_BIN@
IPPTRANSFORM_HTML	=	@IPPTRANSFORM_HTML@
IPPTRANSFORM_MAN	=	@IPPTRANSFORM_MAN@
IPPTRANSFORM3D_BIN	=	@IPPTRANSFORM3D_BIN@
IPPTRANSFORM3D_HTML	=	@IPPTRANSFORM3D_HTML@
IPPTRANSFORM3D_MAN	=	@IPPTRANSFORM3D_MAN@


#
# Programs...
#

AR		=	@AR@
AWK		=	@AWK@
CC		=	@CC@
CHMOD		=	@CHMOD@
GZIP		=	@GZIP@
INSTALL		=	@INSTALL@
RANLIB		=	@RANLIB@
RM		=	@RM@ -f
RMDIR		=	@RMDIR@
SED		=	@SED@
SHELL		=	/bin/sh

#
# Installation programs...
#

INSTALL_BIN	=	$(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
INSTALL_DATA	=	$(INSTALL) -c -m 444
INSTALL_DIR	=	$(INSTALL) -d
INSTALL_LIB	=	$(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
INSTALL_MAN	=	$(INSTALL) -c -m 444

#
# Libraries...
#

LIBZ		=	@LIBZ@

#
# Program options...
#
# ARCHFLAGS     Defines the default architecture build options.
# OPTIM         Defines the common compiler optimization/debugging options
#               for all architectures.
# OPTIONS       Defines other compile-time options (currently only -DDEBUG
#               for extra debug info)
#

ALL_CFLAGS	=	-I.. -D_CUPS_SOURCE -DCUPS_LITE $(CFLAGS) $(TLSFLAGS) \
			@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
ALL_CXXFLAGS	=	-I.. -D_CUPS_SOURCE -DCUPS_LITE $(CXXFLAGS) $(TLSFLAGS) \
			@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
ARCHFLAGS	=	@ARCHFLAGS@
ARFLAGS		=	@ARFLAGS@
CFLAGS		=	@CPPFLAGS@ @CFLAGS@
COMMONLIBS	=	@LIBS@
DNSSDLIBS	=	@DNSSDLIBS@
LDFLAGS		=	@LDARCHFLAGS@ @LDFLAGS@ $(OPTIM)
LINKCUPS	=	../cups/libcups.a $(TLSLIBS) $(DNSSDLIBS) $(LIBZ)
LIBS		=	$(LINKCUPS) $(COMMONLIBS)
OPTIM		=	@OPTIM@
OPTIONS		=
PAMLIBS		=	@PAMLIBS@
TLSFLAGS	=	@TLSFLAGS@
TLSLIBS		=	@TLSLIBS@


#
# Directories...
#
# The first section uses the GNU names (which are *extremely*
# difficult to find in a makefile because they are lowercase...)
# We have to define these first because autoconf uses ${prefix}
# and ${exec_prefix} for most of the other directories...
#
# The "datarootdir" variable may not get defined if you are using
# a version of autoconf prior to 2.60.
#
# This is immediately followed by definition in ALL CAPS for the
# needed directories...
#

bindir		=	@bindir@
datadir		=	@datadir@
datarootdir	=	@datarootdir@
exec_prefix	=	@exec_prefix@
includedir	=	@includedir@
infodir		=	@infodir@
libdir		=	@libdir@
libexecdir	=	@libexecdir@
localstatedir	=	@localstatedir@
mandir		=	@mandir@
oldincludedir	=	@oldincludedir@
prefix		=	@prefix@
privateinclude	=	@privateinclude@
sbindir		=	@sbindir@
sharedstatedir	=	@sharedstatedir@
srcdir		=	@srcdir@
sysconfdir	=	@sysconfdir@
top_srcdir	=	@top_srcdir@

BUILDROOT	=	$(DSTROOT)$(DESTDIR)
IPP		=	@IPP@


#
# Rules...
#

.SILENT:
.SUFFIXES:	.a .c .h .o

.c.o:
	echo Compiling $<...
	$(CC) $(ARCHFLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
