# This is a make file inclusion, to be included in all the Netpbm make
# files.

# This file is meant to contain variable settings that customize the
# build for a particular target system configuration.

# The distribution contains the file Makefile.config.in and an exact
# copy of it named Makefile.config.  You edit Makefile.config to fit
# your system and leave Makefile.config.in alone.

# As distributed, Makefile.config is complete and is what the
# maintainer uses to build on his GNU/Linux/x86 system.

# Some of the variables that the including make file must set for this
# file to work:
#
#  SRCDIR: The directory at the top of the Netpbm source tree.  Note that
#  this is typically a relative directory, and it must be relative to the
#  make file that includes this file.  So it's normally "..".
#
#  CDEBUG: temporary extra compiler options for every compile.  Normally, 
#  you set this this via the Make command line, e.g. "make CDEBUG=-g" or
#  "make CDEBUG=-Werror".

# STATICLIB = Y means to build the Netpbm and Tiff libraries (if
# built) as static libraries instead of shared.  With static
# libraries, you should consider doing a merge build ('make merge')
# instead of the default to save disk space and memory.
#
# For cygwin, only static libraries work, so set STATICLIB = Y  .

#STATICLIB = N
STATICLIB = Y

# The following are commands for the build process to use.  These values
# do not get built into anything.

# The C compiler (including macro preprocessor)
#Tru64:
#CC =		cc
#CC =		gcc
ifeq ($(CPU),PPC)
	CC = ppc-amigaos-gcc -warpup
else
	CC = gcc -noixemul
endif

# The linker.
LD = $(CC)
#LD = ld
#Tru64:
#LD = cc
#LD = gcc 

# MAKE is set automatically by Make to what was used to invoke Make.
SHELL =	/bin/sh

ifeq ($(CPU),PPC)
	INSTALL = /bin/install
else
	INSTALL = /bin/install -s
endif

# Solaris:
#INSTALL = /usr/ucb/install
#Tru64:
#INSTALL = installbsd
#OSF1:
#INSTALL = installosf
# ?
#INSTALL = install

# Normally the man pages are installed using "install".  But via this
# variable, you can use something else, for example a script that
# calls compress or pack.  Mantocat, included with Netpbm, is used on
# systems which use man pages in the "cat" format.

MANCP =	$(INSTALL) -m $(INSTALL_PERM_MAN)
#MANCP = $(SRCDIR)/mantocat

ifeq ($(CPU),PPC)
	AR = ppc-amigaos-ar
	RANLIB = ppc-amigaos-ranlib
else
	AR= ar
	RANLIB=	ranlib
endif

# C compiler options 

# gcc:
# -ansi and -Werror should work too, but are not included
# by default because there's no point in daring the build to fail.
# -pedantic isn't a problem because it causes at worst a warning.
#CFLAGS = -pedantic -O2 -Wall -Wno-uninitialized $(CDEBUG)
# On DEC Tru64 4.0F (at least), you need -DLONG_32 for ppmtompeg.
#Tru64:
#CFLAGS = -O2 -std1 DLONG_32 $(CDEBUG)

ifeq ($(CPU),PPC)
	CFLAGS = -Wall -O3 -ffast-math -fomit-frame-pointer -mmultiple -mcpu=603e
else
	CFLAGS = -Wall -O2 -ffast-math -fomit-frame-pointer -msoft-float -m68020-60
endif

# EXE is a suffix that the linker puts on any executable it generates.
# In cygwin, this is .exe and most programs deal with its existence without
# us having to know about it.  Some don't though, so set this:

EXE =
#EXE = .exe
  
# linker options.  

ifeq ($(CPU),PPC)
	LDFLAGS = $(CFLAGS)
else
	LDFLAGS = $(CFLAGS) -lm
endif

# Eunice users may want to use -noshare so that the executables can
# run standalone:
#LDFLAGS = -noshare
#Tru64:
#LDFLAGS = -call-shared
# Many systems, including SunOS and Solaris, and NetBSD, need options to 
# tell where Netpbm libraries will be at runtime.  Even if you don't need
# it, you may prefer to use it than to set up environment variables or 
# configuration files at runtime to give the same information.
# For a traditional linker:
#LDFLAGS = -R$(INSTALLLIBS)
#If the linker is gcc (e.g. NetBSD):
#LDFLAGS = -Wl,--rpath,$(INSTALLLIBS)

# Linker options for created Netpbm shared libraries.

# Here, $(SONAME) resolves to the soname for the shared library being created.
# The following are gcc options.  This works on GNU libc systems.
LDSHLIB = -shared -Wl,-soname,$(SONAME)
# You need -nostart instead of -shared on BeOS.  Though the BeOS compiler is
# ostensibly gcc, it has the -nostart option, which is not mentioned in gcc
# documentation and doesn't exist in at least one non-BeOS installation.
# BeOS doesn't have sonames built in.
#LDSHLIB = -nostart
#LDSHLIB = -G
# Solaris, SunOS with GNU Ld:
# (You need -R here, as above, because the Netpbm
# libraries depend on each other.  These systems have no soname option).
#LDSHLIB = -shared -R$(INSTALLLIBS)
# Solaris with Sun Ld:
#LDSHLIB = -Wl,-B,dynamic,-G,-h,$(SONAME) 
#Tru64:
#LDSHLIB = -shared -expect_unresolved "*"

# On older systems, you have to make shared libraries out of position 
# independent code, so you need -fpic or fPIC here.  (The rule is: if 
# -fpic works, use it.  If it bombs, go to fPIC).

CFLAGS_SHLIB = 
# Solaris, SunOS, and NetBSD:
#CFLAGS_SHLIB = -fpic
#CFLAGS_SHLIB = -fPIC

# The netpbm package contains a version of the Tiff library,
# libtiff.  If you want to use your own, fill in the appropriate paths
# below for the library and its interface headers

# Put the location of the TIFF library here.  Netpbm comes with a version
# of the TIFF library, so you can just specify the library in the Netpbm
# source tree unless you want to use your own TIFF library.  If you 
# specify the included TIFF library, 'make install' will also install it,
# but otherwise will not.

# Use the Tiff library included with Netpbm:
TIFFHDR_DIR = NONE
TIFFLIB_DIR = NONE
#NetBSD:
#TIFFHDR_DIR = $(LOCALBASE)/include
#TIFFLIB_DIR = $(LOCALBASE)/lib
# OSF, Tru64:
#TIFFHDR_DIR = /usr/local1/DEC/include
#TIFFLIB_DIR = /usr/local1/DEC/lib

# Put the location of your JPEG library here.
# If you want to build the jpeg converters or tiff
# converters that use jpeg compression in tiff files, you must have
# the jpeg library already installed.  Put the locations of the link
# library and the interface header files here.  If you do not have the
# JPEG library, and still want to successully build everything else,
# including non-JPEG versions of the tiff converters, put NONE for
# these.

# Special note for people using an already-installed Tiff library:  If
# your library was built with the JPEG stuff statically linked in, you
# don't need the JPEG library and the tiff converters will still do jpeg.
# If your library references a dynamic JPEG library, you must specify
# at least JPEGLIB_DIR here, or the tiff converters will not build at
# all.

ifeq ($(CPU),PPC)
	JPEGLIB_DIR = /ade/ppc-amigaos/lib
	JPEGHDR_DIR = /ade/ppc-amigaos/include
else
	JPEGLIB_DIR = /ade/lib
	JPEGHDR_DIR = /ade/include
endif

# Netbsd:
#JPEGLIB_DIR = ${LOCALBASE}/lib
#JPEGHDR_DIR = ${LOCALBASE}/include
# OSF, Tru64:
#JPEGLIB_DIR = /usr/local1/DEC/lib
#JPEGHDR_DIR = /usr/local1/DEC/include
# Typical:
#JPEGLIB_DIR = /usr/local/lib
#JPEGHDR_DIR = /usr/local/include
# Don't build JPEG stuff:
#JPEGLIB_DIR = NONE
#JPEGHDR_DIR = NONE


# Put the location of your PNG library here.  If you want to build the
# PNG converters you must have the PNG library already installed.  Put
# the locations of the link library and the interface header files
# here.  If you do not have the PNG library, and still want to
# successully build everything else, put NONE for these.

ifeq ($(CPU),PPC)
	PNGLIB_DIR = /ade/ppc-amigaos/lib
	PNGHDR_DIR = /ade/ppc-amigaos/include
else
	PNGLIB_DIR = /ade/lib
	PNGHDR_DIR = /ade/include
endif

# NetBSD:
#PNGLIB_DIR = $(LOCALBASE)/lib
#PNGHDR_DIR = $(LOCALBASE)/include
# OSF/Tru64:
#PNGLIB_DIR = /usr/local1/DEC/lib
#PNGHDR_DIR = /usr/local1/DEC/include
# Typical:
#PNGLIB_DIR = /usr/local/lib
#PNGHDR_DIR = /usr/local/include
# No PNG:
#PNGLIB_DIR = NONE
#PNGHDR_DIR = NONE


# And the Utah Raster Toolkit (aka URT aka RLE) library:

URTHDR_DIR = NONE
URTLIB_DIR = NONE

# These are -l options to link in the network libraries.  Often, these are
# built into the standard C library, so this can be null.  If you don't 
# want any network functions, make it NONE.  The only thing that requires
# network functions is the option in ppmtompeg to run it on multiple
# computers simultaneously.

NETWORKLD = NONE
# Solaris, SunOS:
#NETWORKLD = -lsocket -lnsl
# Don't build network functions:
#NETWORKLD = NONE

VMS = 
#VMS:
#VMS = yes

# The following variables are used only by 'make install' (and the
# variants of it).  Paths here don't, for example, get built into any
# programs.

# EXCEPTION: If you used a -R $(INSTALL_LIBS) option above,
# then INSTALL_LIBS gets built into your shared libraries.

# File permissions for installed files.
# Note that on some systems (e.g. Solaris), 'install' can't use the 
# mnemonic permissions - you have to use octal.

# binaries (pbmmake, etc)
INSTALL_PERM_BIN =  755       # u=rwx,go=rx
# shared libraries (libpbm.so, etc)
INSTALL_PERM_LIBD = 755       # u=rwx,go=rx
# static libraries (libpbm.a, etc)
INSTALL_PERM_LIBS = 644       # u=rw,go=r
# header files (pbm.h, etc)
INSTALL_PERM_HDR =  644       # u=rw,go=r
# man pages (pbmmake.1, etc)
INSTALL_PERM_MAN =  644       # u=rw,go=r

# Everything gets installed relative to directory INSTALL_PREFIX.  If
# you're spreading Netpbm across your system, use "/".

# DEC Tru64:
#INSTALL_PREFIX = /usr/local1/DEC/packages/netpbm
# Typical:
#INSTALL_PREFIX = /usr/local/
INSTALL_PREFIX = /temp/netpbm

# Some people specify PREFIX= on the command line, because that's conventional
ifneq ($(PREFIX)x,x)
  INSTALL_PREFIX = $(PREFIX)
endif

# Specify the directory where you want the executables.
# If you need scripts and binaries to be in different directories, you
# can set that up too.

INSTALLBINARIES = $(INSTALL_PREFIX)/bin
#INSTALLBINARIES = /usr/local/bin/netpbm
INSTALLSCRIPTS = $(INSTALLBINARIES)

# Specify the directory where you want the shared libraries
# installed.  For this to be effective, you must have set up this location
# to be searched by your system's program executor for runtime libraries.

INSTALLLIBS = $(INSTALL_PREFIX)/lib
#INSTALLLIBS = /usr/local/lib/netpbm 

# Specify the directories that you want the man page sources,
# plus the suffix you want them to have.

INSTALLMANUALS1 =	$(INSTALL_PREFIX)/man/man1
SUFFIXMANUALS1 =	1
INSTALLMANUALS3 =	$(INSTALL_PREFIX)/man/man3
SUFFIXMANUALS3 =	3
INSTALLMANUALS5 =	$(INSTALL_PREFIX)/man/man5
SUFFIXMANUALS5 =	5


# Specify the directory where you want the interface header files for
# the Netpbm (and possibly Tiff) libraries installed.

INSTALLHDRS = $(INSTALL_PREFIX)/include


#NETPBMLIBSUFFIX is the suffix on the filename of the generated and installed
#Netpbm libraries.  But you can't make it just anything, because there has to
#be a rule in the makefiles to make whatever the fliename turns out to be.
#Only .a and .so work.
ifeq ($(STATICLIB),Y)
  NETPBMLIBSUFFIX = a
  LIBTIFFSUFFIX = a
else
  NETPBMLIBSUFFIX = so
  LIBTIFFSUFFIX = so
endif





