# -*-makefile-*----------------------------------------------------------------
# $Id: initlib.in,v 1.16 1998/04/07 17:33:58 furnish Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 24-Jul-1994
#
# Initializations for building PLplot library.
# -----------------------------------------------------------------------------

# Package major/minor version number, for shared libraries on some systems
# (e.g. SunOS).  Warning: apps linked to it may fail on major version
# changes (depending on OS), and right now this doesn't mean much, so
# by default these are not yet used.

MAJOR_VERSION	= 4
MINOR_VERSION	= 99

# Utilities

RANLIB		= @RANLIB@
ARLIB_BUILD	= ar q
SHLIB_BUILD	= @SHLIB_BUILD@

# Flags and other miscellanea

SO		= @SO@
SA		= @SA@
SHARED		= @SHARED@

CC_FLAGS	= @CC_FLAGS@ @INCS@
CXX_FLAGS	= @CXX_FLAGS@

CC_FLAGS_DEMOS	= $(CC_FLAGS)
CXX_FLAGS_DEMOS	= $(CXX_FLAGS)

SHLIB_CCFLAGS	= @SHLIB_CCFLAGS@
SHLIB_CXXFLAGS	= @SHLIB_CXXFLAGS@
SHLIB_F77FLAGS	= @SHLIB_F77FLAGS@
SHLIB_LIBS	= @SHLIB_LIBS@

# Dependent directories

PLLIB_DIR	= .
PLFNT_DIR	= .
PLLIB_PATH	= $(PLLIB_DIR)/
PLFNT_PATH	= $(PLFNT_DIR)/

# The library components

LIB_OBJS_SO	= $(CORE_OBJ) $(TCL_OBJ) $(TK_OBJ) $(DRIVERS_OBJ) $(ADD_DRIVERS_OBJ) $(FSTUB_OBJ) $(CXX_OBJ)
LIB_OBJS_SA	= $(TCL_OBJ_SA) $(TK_OBJ_SA) $(FSTUB_OBJ_SA)
LIB_OBJS	= $(LIB_OBJS_SO) $(LIB_OBJS_SA)

# Library names

PLLIB_AR	= $(PLLIB_PATH)$(PLLIB_BASE)$(LIB_TAG)$A
PLLIB_SO	= $(PLLIB_PATH)$(PLLIB_BASE)$(LIB_TAG)$(SO)
PLLIB_SA	= $(PLLIB_PATH)$(PLLIB_BASE)$(LIB_TAG)$(SA)

# The following corrects error detected by Lintian
# ldconfig-symlink-referencing-wrong-file (should not link to ./*
# file)
PLLIB_SO	= $(PLLIB_PATH)$(PLLIB_BASE)$(LIB_TAG)$(SO)

# This is used for making the install versions of plrender & plserver
# (Must relink after installing shared library!)

LIB_INSTALL	= -L$(LIB_DIR)/.. -l$(PLLIB_NAME)$(LIB_TAG) $(MAT_LINK)
#LIB_INSTALL	= -L$(LIB_DIR) -l$(PLLIB_NAME) $(MAT_LINK)

# These are what we link against.

PLLIB_LDC	= -L$(PLLIB_DIR) -l$(PLLIB_NAME)$(LIB_TAG) $(MAT_LINK)
PLLIB_LDF	= -L$(PLLIB_DIR) -l$(PLLIB_NAME)$(LIB_TAG) $(MAT_LINK)

# Header file dependencies for demos.
# Done this way to only pick up the dependency during development, and not
# when installed (since then headers are found by the include search path,
# and the library can't be rebuilt anyway).

CDEMO_HEADERS	= plcdemos.h plplot.h

# Default is to build library(s) and utils.

everything: libs plrender$E pltek$E $(PYTHON_EXE) $(TCL_EXE) $(TK_EXE)

# Clear the suffix list to prevent problems.

.SUFFIXES:
.SUFFIXES: $O .cc .c .f .h .fm4

# Inference rules, not specific to archive or shared libraries.

.fm4.f:
	$(M4) $(M4_FLAGS) $< >$*.f

