# -----------------------------------------------------------------------
# $Id: initlib.in,v 1.8 2003/09/28 13:34:28 aroach Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 24-Jul-1994
#
# Initializations for building PLplot library.
# -----------------------------------------------------------------------


# Utilities

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

# Flags and other miscellanea

CC_FLAGS	:= $(CC_FLAGS) -c -O -I.
CC_FLAGS_DEMOS	= -c -O -I.
SHLIB_CCFLAGS	= @SHLIB_CCFLAGS@
SHLIB_F77FLAGS	= @SHLIB_F77FLAGS@
SHLIB_SUFFIX	= @SHLIB_SUFFIX@
SALIB_SUFFIX	= @SALIB_SUFFIX@

# Hacks to deal with optimizer failures.

CC_FLAGS_SCCONT = -c -O -I.
CC_FLAGS_XWIN	= -c -O -I.

# Dependent directories

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

# The library components

LIB_OBJS_SO	= $(CORE_OBJ) $(TCL_OBJ) $(TK_OBJ) $(DRIVERS_OBJ) $(FSTUB_OBJ)
LIB_OBJS_SA	= $(TCL_OBJ_SA) $(TK_OBJ_SA) $(FSTUB_OBJ_SA)
LIB_OBJS	= $(LIB_OBJS_SO) $(LIB_OBJS_SA)
DEMOS_RPATH	= $(RPATH)

# Library names

PLLIB_AR	= $(PLLIB_PATH)libplplt$(LIB_TAG).a
PLLIB_SH	= $(PLLIB_PATH)libplplt$(LIB_TAG)$(SHLIB_SUFFIX)
PLLIB_SA	= $(PLLIB_PATH)libplplt$(LIB_TAG)$(SALIB_SUFFIX)

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

LIB_INSTALL	= -L$(LIB_DIR2) -lplplt$(LIB_TAG)

# These are what we link against.

PLLIB_LDC	= -L$(PLLIB_DIR) -lplplt$(LIB_TAG)
PLLIB_LDF	= -L$(PLLIB_DIR) -lplplt$(LIB_TAG)

# 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	= plplot/plcdemos.h plplot/plplot.h

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

everything: libs plrender$E pltek$E $(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
