# Generated automatically from Makefile.in by configure.
# -*-makefile-*----------------------------------------------------------------
# $Id: init.in,v 1.25 2001/03/26 08:10:40 rlaboiss Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 14-Jul-1994
#
# Basic make assignments for PLplot under Unix (driven by "configure").
# These are used in both the library and demo Makefiles.
# -----------------------------------------------------------------------------

srcdir = /sware/exp/scisoft/ESRF_sw/linux_i386/PACKAGES/plplot
top_srcdir = /sware/exp/scisoft/ESRF_sw/linux_i386/PACKAGES/plplot

# Utilities

CXX		= g++ -fPIC
LDCXX		= g++ -fPIC
CC		= gcc -fPIC
LDC		= gcc -fPIC
OCC		= gcc -fPIC
F77		= g77 -fPIC
LDF		= g77 -fPIC
M4		= m4

# Force everything.  If unsure, test for existence first.
# Redefine these as needed in system-specific setup.

CP		= cp -p
LN		= ln -sf
RM		= rm -f
MV		= mv -f

# Flags and other miscellanea

F77_FLAGS	= 
LDC_FLAGS	=    
LDCXX_FLAGS	=    	 
LDF_FLAGS	= 
LDC_LIBS	=  -L/usr/X11/lib -lX11 -ldl -lm
LDCXX_LIBS	=  -L/usr/X11/lib -lX11 -ldl -lm
LDF_LIBS	=  -L/usr/X11/lib -lX11 -ldl -lm
LIB_TAG		= d
TO		= -o
O		= .o
A		= .a
E		=
RPATH		= 
INSTALL_RPATH	= 

# Library names
# (PLLIB_NAME) is for ld/linking
# (PLLIB_BASE) is the base library name for installation
#
# good for filesystems that truncate names (eg, DOS), but need
# unique names that don't clash with other system names, hence
# pl prefix.

PLLIB_NAME	= plplot
CXXLIB_NAME	= plcxx
MATLIB_NAME	= 
PLLIB_BASE	= lib$(PLLIB_NAME)
CXXLIB_BASE	= lib$(CXXLIB_NAME)
MATLIB_BASE	= lib$(MATLIB_NAME)

# Install directories

PREFIX		= /usr/local/plplot

LIB_DIR		= $(PREFIX)/lib
DATA_DIR	= $(PREFIX)/lib/plplot5.1.0/data
DOC_DIR		= $(PREFIX)/share/doc/plplot
BIN_DIR		= $(PREFIX)/bin
INFO_DIR	= $(PREFIX)/share/info
INCLUDE_DIR	= $(PREFIX)/include/plplot
TCL_DIR		= $(PREFIX)/lib/plplot5.1.0/tcl
DEMOS_DIR	= $(PREFIX)/lib/plplot5.1.0/examples

# -*-makefile-*----------------------------------------------------------------
# $Id: dist.in,v 1.15 2001/11/26 03:28:10 jcard Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 22-Jul-1994
#
# PLplot source and object file lists.
# -----------------------------------------------------------------------------

# The default target -- a convenient forward reference

default: everything

# Core library files.

CORE_C = \
	pdfutils.c \
	plargs.c \
	plbox.c \
	plbuf.c \
	plcont.c \
	plcore.c \
	plctrl.c \
	plcvt.c \
	pldtik.c \
	plfill.c \
	plhist.c \
	plline.c \
	plmap.c \
	plot3d.c \
	plpage.c \
	plsdef.c \
	plshade.c \
	plsym.c \
	pltick.c \
	plvpor.c \
	plwind.c \
	plstripc.c \
	plimage.c

CORE_OBJ = \
	pdfutils$O \
	plargs$O \
	plbox$O \
	plbuf$O \
	plcont$O \
	plcore$O \
	plctrl$O \
	plcvt$O \
	pldtik$O \
	plfill$O \
	plhist$O \
	plline$O \
	plmap$O \
	plot3d$O \
	plpage$O \
	plsdef$O \
	plshade$O \
	plsym$O \
	pltick$O \
	plvpor$O \
	plwind$O \
	plstripc$O \
	plimage$O

# Support files for font generators.

FONT_OBJ = \
	font01$O \
	font02$O \
	font03$O \
	font04$O \
	font05$O \
	font06$O \
	font07$O \
	font08$O \
	font09$O \
	font10$O \
	font11$O

# Utilities

UTIL_C = \
	plrender.c \
	plserver.c \
	pltcl.c 

# Driver stuff

STATIC_DRIVERS	=  plmeta null tek dg300 ps xfig ljii hpgl ljiip impress xwin pbm pstex
DYNAMIC_DRIVERS	= 

static_drivers_obj := $(STATIC_DRIVERS:%=%$(O))

# Fortran language stubs for linking Plplot to Fortran.
# I keep these dependencies here because (a) they use an implicit build
# rule, and (b) can't easily be autogenerated.

strutil$O:	strutil.f
sfstubs$O:	sfstubs.f
sfstubs.f:	sfstubs.fm4 fmacs.m4

# -*-makefile-*----------------------------------------------------------------
# $Id: pkg_cxx.in,v 1.13 2001/02/03 00:36:16 rlaboiss Exp $
#
# Geoffrey Furnish
# IFS, University of Texas at Austin
# 6-Oct-1994
#
# Make assignments and targets for PLplot/C++ interface layer.
# -----------------------------------------------------------------------------

CXX_C		= plstream.cc
CXX_OBJS	= plstream$O
CXX_OBJS_SO	=
CXX_OBJS_SA	=

# Variables used in accessing libraries.
# These can be overridden in system-dependent files.

CXXLIB_AR	= $(PLLIB_PATH)$(CXXLIB_BASE)$(LIB_TAG)$A
CXXLIB_SO	= $(PLLIB_PATH)$(CXXLIB_BASE)$(LIB_TAG)$(SO)
CXXLIB_SA	= $(PLLIB_PATH)$(CXXLIB_BASE)$(LIB_TAG)$(SA)
CXX_LINK	= -l$(CXXLIB_NAME)$(LIB_TAG)

# Variables for use in "make" and "make install".

BLD_CXXLIB_AR	= $(CXXLIB_AR)
BLD_CXXLIB_SO	= $(CXXLIB_SO)
BLD_CXXLIB_SA	= $(CXXLIB_SA)
INSTALL_CXX	= install_cxx
INSTALL_CXXLIB	= install_cxxlib

# Targets

install_cxx_includes:
	@-cd $(top_srcdir)/bindings/c++; $(CP) plstream.h $(INCLUDE_DIR)

install_cxx_demos:
	@-if test ! -d $(DEMOS_DIR)/c++; then mkdir -p $(DEMOS_DIR)/c++; fi; \
	  $(LN) ../Makefile $(DEMOS_DIR)/c++; \
	  cd $(top_srcdir)/examples/c++; $(CP) *.cc $(DEMOS_DIR)/c++

install_cxx: install_cxx_includes install_cxx_demos

install_cxxlib:
	@-$(CP) $(CXXLIB_BASE)* $(LIB_DIR); \
	  if test -r $(CXXLIB_BASE)$(LIB_TAG)$A; then \
	      $(RANLIB) $(LIB_DIR)/$(CXXLIB_BASE)$(LIB_TAG)$A; \
	  fi
# -*-makefile-*----------------------------------------------------------------
# $Id: pkg_python.in,v 1.29 2002/01/29 19:38:49 airwin Exp $
#
# Make assignments for PLplot/Python support.
#
# Python supports dynamically loaded libraries, and we use the canonical
# method recommended at http://www.python.org/doc/current/ext/building-on-unix.html
# to build these libraries.  It is claimed this method will work for all
# Unix systems.  
#
# For our implementation of this method, at configuration time we symlink all
# required files but Setup.in into tmp/python_dynamic, and at build time
# and install time (where we link differently) we create the required 
# two-line Setup.in in the same directory and build according to the
# canonical rules.
# Note we build in a separate special directory because the build process
# creates a Makefile which would nameclash with other directories that have a
# Makefile in them (e.g., tmp).
# -----------------------------------------------------------------------------

SO		= 
PYTHON_EXE	= plmodule$(SO)
PYQT_PYTHON_EXE	= pyqt_plmodule$(SO)
PYTHON_INC_DIR	= /sware/exp/scisoft/ESRF_sw/linux_i386/include/python2.2
PYTHON_NUM_DIR	= /sware/exp/scisoft/ESRF_sw/linux_i386/include/python2.2/Numeric
PYTHON_MOD_DIR	= /sware/exp/scisoft/ESRF_sw/linux_i386/lib/python2.2
PYTHON_MACH_DIR	= 
PYTHON_CFG_DIR	= /sware/exp/scisoft/ESRF_sw/linux_i386/lib/python2.2/config
#These libraries do not exist on Linux systems (at least for python-1.5) so
#must comment out.  If required on other systems, must do something fancy.
#PYTHON_LIBS	= -L$(PYTHON_CFG_DIR) -lModules -lObjects -lParser -lPython
PYTHON_LIBS=
PYTHON_DIR	= NONE/python
LDSHARED	= 

PYTHON_DEMOS	= pytkdemo *.py

# Variables for use in "make" and "make install".

INSTALL_PYTHON	= install_python

PYTHON_INSTDIR = $(PREFIX)/python

install_python: python_dynamic/plmodule.c \
	python_dynamic/pyqt_plmodule.c
	@cd python_dynamic ; make -s -f Makefile.pre.in distclean
	@echo '*shared*' > python_dynamic/Setup.in
	@echo 'pl plmodule.c -I$(INCLUDE_DIR)/.. -I$(PYTHON_INC_DIR) -I$(PYTHON_NUM_DIR) $(LIB_INSTALL) $(LDC_LIBS) $(INSTALL_RPATH)' >> python_dynamic/Setup.in
	@cd python_dynamic ; make -s -f Makefile.pre.in boot ; make -s ; \
	 $(MV) $(PYTHON_EXE) ..
	@cd python_dynamic ; make -s -f Makefile.pre.in distclean
	@echo '*shared*' > python_dynamic/Setup.in
	@echo 'pyqt_pl pyqt_plmodule.c -I$(INCLUDE_DIR)/.. -I$(PYTHON_INC_DIR) -I$(PYTHON_NUM_DIR) $(LIB_INSTALL) $(LDC_LIBS) $(INSTALL_RPATH)' >> python_dynamic/Setup.in
	@cd python_dynamic ; make -s -f Makefile.pre.in boot ; make -s ; \
	 $(MV) $(PYQT_PYTHON_EXE) ..
	@-if test ! -d $(PYTHON_INSTDIR); then mkdir -p $(PYTHON_INSTDIR); fi
	@-$(CP) $(PYTHON_EXE) $(PYTHON_INSTDIR)
	@-$(CP) $(PYQT_PYTHON_EXE) $(PYTHON_INSTDIR)
	@-if test "$(PYTHON_DIR)" != "$(PYTHON_MACH_DIR)"; then \
	  echo "PLplot Python module installation warning:" ; \
	  echo "" ; \
	  echo "The install location $(PYTHON_DIR) for"  ; \
	  echo "plmodule.so is not the same as the expected Python location for"  ; \
	  echo "dynamic libraries $(PYTHON_MACH_DIR)"  ; \
	  echo "so you must set the environment variable PYTHONDIR to the install"  ; \
	  echo "location in order to make the Python PLplot module(s) work." ; \
	fi
	@-if test ! -d $(DEMOS_DIR)/python; then mkdir -p $(DEMOS_DIR)/python; fi
	@-cd $(top_srcdir)/examples/python ; \
	$(CP) README.pythondemos $(DEMOS_DIR)/python ; \
	for i in $(PYTHON_DEMOS) ; do \
	  sed 's:@MODULE_DIR@:$(PYTHON_DIR):' < $$i > $(DEMOS_DIR)/python/$$i ; \
	  chmod a+rx $(DEMOS_DIR)/python/$$i ; \
	done ;\
	for i in xw??.py ; do \
	  chmod a-x $(DEMOS_DIR)/python/$$i ; \
	done
# -*-makefile-*----------------------------------------------------------------
# $Id: initlib.in,v 1.35 2002/03/13 19:28:06 furnish Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 24-Jul-1994
#
# Initializations for building PLplot library.
# -----------------------------------------------------------------------------

# Package major/minor/release version number, for shared libraries on some systems
# (e.g. Linux).  Warning: apps linked to it may fail on major version
# changes (depending on OS).

MAJOR_VERSION	= 5
MINOR_VERSION	= 1
RELEASE_VERSION	= 0

# Utilities

RANLIB		= ranlib
ARLIB_BUILD	= ar q
ARLIB_BUILD_CXX	= $(ARLIB_BUILD)
SHLIB_BUILD	= 
SHLIB_BUILD_CXX	= 

# Flags and other miscellanea

SO		= 
SA		= 
SHARED		= 0

CC_FLAGS	= -c          -O    -I.
CXX_FLAGS	= -c    	  -O   -I.

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

SHLIB_CCFLAGS	= 
SHLIB_CXXFLAGS	= 
SHLIB_F77FLAGS	= 
SHLIB_LIBS	= 
SONAME_FLAGS	= 

# Dependent directories

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

# The library components

#LIB_OBJS_SO	= $(CORE_OBJ) $(TCL_OBJ) $(TK_OBJ) $(GNOME_OBJ) $(static_drivers_obj) $(FSTUB_OBJ) $(JAVA_OBJ)
LIB_OBJS_SO	= $(CORE_OBJ) $(TCL_OBJ) $(TK_OBJ) $(static_drivers_obj) $(FSTUB_OBJ) $(JAVA_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)$(PLLIB_BASE)$(LIB_TAG)$A
PLLIB_SO	= $(PLLIB_PATH)$(PLLIB_BASE)$(LIB_TAG)$(SO)
PLLIB_SA	= $(PLLIB_PATH)$(PLLIB_BASE)$(LIB_TAG)$(SA)

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)

# These are what we link against.

PLLIB_LDC	= -L$(PLLIB_DIR) -l$(PLLIB_NAME)$(LIB_TAG) $(MAT_LINK)
PLLIB_LDCXX	= -L$(PLLIB_DIR) $(CXX_LINK) -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	= plplot/plcdemos.h plplot/plplot.h

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

DYNLOAD_STUFF := dynamic_drivers_target

everything: libs plrender$E pltek$E $(PYTHON_EXE) $(PYQT_PYTHON_EXE) \
	$(TCL_EXE) $(TK_EXE) $(OCTAVE_EXE) \
	$(DYNLOAD_STUFF) $(JAVA_STUFF)

# 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) -S2000 -B8192 -DDOUBLE $< >$*.f

# -*-makefile-*----------------------------------------------------------------
# $Id: lib_ar.in,v 1.16 2002/01/21 19:02:38 furnish Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 14-Jul-1994
#
# PLplot build rule for library under Unix.
# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# Set up inference rules appropriate for building archive libraries.
# -----------------------------------------------------------------------------

.cc$O:
	$(CXX) $(CXX_FLAGS) $<

.c$O:
	$(CC) $(CC_FLAGS) $<

.f$O:
	$(F77) $(F77_FLAGS) $<

# -----------------------------------------------------------------------------
# Library dependency list and targets
# -----------------------------------------------------------------------------

PLLIBS = $(PLLIB_AR) $(MATLIB_AR) $(CXXLIB_AR)

# These need to use the BLD_ prefix so they can be left out.
MATLIBS = $(BLD_MATLIB_AR)
CXXLIBS = $(BLD_CXXLIB_AR)

libs:	$(PLLIBS) $(MATLIBS) $(CXXLIBS)

$(PLLIB_AR):	$(LIB_OBJS)
	-$(RM) $(PLLIB_AR)
	@echo ""; echo "Building archive library"; echo ""
	$(ARLIB_BUILD) $(PLLIB_AR) $(LIB_OBJS)
	$(RANLIB) $(PLLIB_AR)
	@echo ""

$(MATLIB_AR): $(MAT_OBJS)
	-$(RM) $(MATLIB_AR)
	@echo ""; echo "Building archive library"; echo ""
	$(ARLIB_BUILD) $(MATLIB_AR) $(MAT_OBJS)
	$(RANLIB) $(MATLIB_AR)
	@echo ""

$(CXXLIB_AR): $(CXX_OBJS)
	-$(RM) $(CXXLIB_AR)
	@echo ""; echo "Building archive library"; echo ""
	$(ARLIB_BUILD_CXX) $(CXXLIB_AR) $(CXX_OBJS)
	$(RANLIB) $(CXXLIB_AR)
	@echo ""

# -*-makefile-*----------------------------------------------------------------
# $Id: exes.in,v 1.22 2002/01/04 20:59:23 airwin Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 19-Jul-1994
#
# PLplot program file dependencies and targets.
# 
# Targets supported here include: 
#
#	plrender	Metafile viewer
#	pltek		Renderer for tek files
#	fonts		font generators and font files
#	pltcl		PLplot tcl interpreter (i.e. enhanced tclsh)
#	plserver	PLplot tcl/tk interpreter (i.e. enhanced wish).
#			Handles plplot Tk driver rendering.
#	plmodule	Dynamically loaded module for PLplot python scripts
#
#
# All but "fonts" are in the default build rule.
# Note: the portable font files are supplied in the distribution
# and normally do not need to be rebuilt.
# -----------------------------------------------------------------------------

# Utility programs.

pltek$E:	pltek$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) pltek$O $(TO) $@ $(RPATH)

# This is what the pltek build rule used to be, but it's wrong, b/c
# pltek doesn't need to link with tk, tcl, X11, etc.  Should make a
# new macro for libs this thing depends on...
#	$(LDC) $(LDC_FLAGS) $(STARTUP) pltek$O $(TO) $@ \
#		$(LDC_LIBS)

plrender$E:	$(PLLIBS) plrender$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) plrender$O $(PLLIB_LDC) $(TO) $@ \
		$(LDC_LIBS) $(RPATH)

pltcl$E:	$(PLLIBS) pltcl$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) pltcl$O $(PLLIB_LDC) $(TO) $@ \
		$(LDC_LIBS)  $(RPATH)

plserver$E:	$(PLLIBS) plserver$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) plserver$O $(PLLIB_LDC) $(TO) $@ \
		$(LDC_LIBS) $(RPATH)

# -----------------------------------------------------------------------------
# note this only builds something that can be used if PYTHONPATH is set 
# to tmp.  Also RPATH puts current directory first.  Therefore only
# really useful for temporary tests in tmp until it is decided to
# do the install.
plmodule$(SO): $(PLLIBS) python_dynamic/plmodule.c
	@echo " "
	@echo "Building Python module."
	@echo " "
	@cd python_dynamic ; make -s -f Makefile.pre.in distclean
	@echo '*shared*' > python_dynamic/Setup.in
	echo 'pl plmodule.c -I. -I$(PYTHON_INC_DIR) -I$(PYTHON_NUM_DIR) -L.. $(PLLIB_LDC) $(LDC_LIBS) $(RPATH)' >> python_dynamic/Setup.in
	cd python_dynamic ; make -s -f Makefile.pre.in boot ; make -s ; \
	$(MV) $(PYTHON_EXE) ..

pyqt_plmodule$(SO): $(PLLIBS) python_dynamic/pyqt_plmodule.c
	@echo " "
	@echo "Building PyQt Python module."
	@echo " "
	@cd python_dynamic ; make -s -f Makefile.pre.in distclean
	@echo '*shared*' > python_dynamic/Setup.in
	echo 'pyqt_pl pyqt_plmodule.c -I. -I$(PYTHON_INC_DIR) -I$(PYTHON_NUM_DIR) -L.. $(PLLIB_LDC) $(LDC_LIBS) $(RPATH)' >> python_dynamic/Setup.in
	cd python_dynamic ; make -s -f Makefile.pre.in boot ; make -s ; \
	$(MV) $(PYQT_PYTHON_EXE) ..

# -----------------------------------------------------------------------------
# Font files.
# Note it is no longer necessary to actually make these since as of
# PLPLOT 4.99a the font files are portable.
#
# sfont - standard font
# xfont - extended fonts

fonts:	sfont xfont

sfont:	$(PLFNT_PATH)plstnd5.fnt
xfont:	$(PLFNT_PATH)plxtnd5.fnt

$(PLFNT_PATH)plstnd5.fnt: stndfont$E pdfutils$O $(FONT_OBJ)
	-./stndfont$E
	-mv *.fnt $(PLFNT_DIR)

$(PLFNT_PATH)plxtnd5.fnt: xtndfont$E pdfutils$O $(FONT_OBJ)
	-./xtndfont$E
	-mv *.fnt $(PLFNT_DIR)

stndfont$E:	$(PLLIBS) stndfont$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) stndfont$O $(FONT_OBJ) \
		$(PLLIB_LDC) $(TO) $@ $(LDC_LIBS)

xtndfont$E:	$(PLLIBS) xtndfont$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) xtndfont$O $(FONT_OBJ) \
		$(PLLIB_LDC) $(TO) $@ $(LDC_LIBS)

# -*-makefile-*----------------------------------------------------------------
# $Id: demos.in,v 1.22 2002/02/26 19:04:17 furnish Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 22-Jul-1994
#
# PLplot demo file dependencies and targets.
# 
# Targets supported here include: 
#
#	cdemos		All the C demos
#	fdemos		All the Fortran demos
#	tkdemos		All the extended wish (TK) demos
#	x??[cf]		Demo number ??, C or fortran versions
#	xtk??		Demo number ??, extended wish versions
#
# Notes:
#  - To aid in development, additional dependencies (autogenerated) are
#    included at the end of the makefile.
#  - Explicit rules are specified for object file generation so that the
#    rules for building a shared library don't get in the way.
#  - CC_FLAGS_DEMOS and CXX_FLAGS_DEMOS were created to contain the extra
#    include file directives needed in the standalone demo makefile.
# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# Example programs, in C.

CDEMOS= x01c$E x02c$E x03c$E x04c$E x05c$E x06c$E x07c$E x08c$E x09c$E \
	x10c$E x11c$E x12c$E x13c$E x14c$E x15c$E x16c$E x17c$E x18c$E \
	x19c$E x20c$E tutor$E

cdemos:	$(CDEMOS)

cdemo_objs := $(CDEMOS: tutor$E=)
cdemo_objs := $(cdemo_objs:$E=$O)

ifdef compile-c-and-emit-deps
# Hmm, $* seems to be behaving strangely...
$(cdemo_objs) : x%c$O : x%c.c
	$(call compile-c-and-emit-deps,$(CC_FLAGS_DEMOS),x$*c,$@)
else
x01c$O: x01c.c
	$(CC) $(CC_FLAGS_DEMOS) x01c.c
x02c$O: x02c.c
	$(CC) $(CC_FLAGS_DEMOS) x02c.c
x03c$O: x03c.c
	$(CC) $(CC_FLAGS_DEMOS) x03c.c
x04c$O: x04c.c
	$(CC) $(CC_FLAGS_DEMOS) x04c.c
x05c$O: x05c.c
	$(CC) $(CC_FLAGS_DEMOS) x05c.c
x06c$O: x06c.c
	$(CC) $(CC_FLAGS_DEMOS) x06c.c
x07c$O: x07c.c
	$(CC) $(CC_FLAGS_DEMOS) x07c.c
x08c$O: x08c.c
	$(CC) $(CC_FLAGS_DEMOS) x08c.c
x09c$O: x09c.c
	$(CC) $(CC_FLAGS_DEMOS) x09c.c
x10c$O: x10c.c
	$(CC) $(CC_FLAGS_DEMOS) x10c.c
x11c$O: x11c.c
	$(CC) $(CC_FLAGS_DEMOS) x11c.c
x12c$O: x12c.c
	$(CC) $(CC_FLAGS_DEMOS) x12c.c
x13c$O: x13c.c
	$(CC) $(CC_FLAGS_DEMOS) x13c.c
x14c$O: x14c.c
	$(CC) $(CC_FLAGS_DEMOS) x14c.c
x15c$O: x15c.c
	$(CC) $(CC_FLAGS_DEMOS) x15c.c
x16c$O: x16c.c
	$(CC) $(CC_FLAGS_DEMOS) x16c.c
x17c$O: x17c.c
	$(CC) $(CC_FLAGS_DEMOS) x17c.c
x18c$O: x18c.c
	$(CC) $(CC_FLAGS_DEMOS) x18c.c
x19c$O: x19c.c
	$(CC) $(CC_FLAGS_DEMOS) x19c.c
x20c$O: x20c.c
	$(CC) $(CC_FLAGS_DEMOS) x20c.c
endif

x01c$E:	$(PLLIBS) x01c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x01c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x02c$E:	$(PLLIBS) x02c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x02c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x03c$E:	$(PLLIBS) x03c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x03c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x04c$E:	$(PLLIBS) x04c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x04c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x05c$E:	$(PLLIBS) x05c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x05c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x06c$E:	$(PLLIBS) x06c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x06c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x07c$E:	$(PLLIBS) x07c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x07c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x08c$E:	$(PLLIBS) x08c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x08c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x09c$E:	$(PLLIBS) x09c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x09c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x10c$E:	$(PLLIBS) x10c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x10c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x11c$E:	$(PLLIBS) x11c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x11c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x12c$E:	$(PLLIBS) x12c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x12c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x13c$E:	$(PLLIBS) x13c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x13c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x14c$E:	$(PLLIBS) x14c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x14c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x15c$E:	$(PLLIBS) x15c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x15c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x16c$E:	$(PLLIBS) x16c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x16c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x17c$E:	$(PLLIBS) x17c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x17c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x18c$E:	$(PLLIBS) x18c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x18c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x19c$E:	$(PLLIBS) x19c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x19c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

x20c$E:	$(PLLIBS) x20c$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) x20c$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

tutor$O: tutor.c
	$(CC) $(CC_FLAGS_DEMOS) tutor.c

tutor$E: $(PLLIBS) tutor$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) tutor$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

# Convenience rules for testing.

bugc$O:	bugc.c
	$(CC) $(CC_FLAGS_DEMOS) bugc.c

bugc$E:	$(PLLIBS) bugc$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) bugc$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

# -----------------------------------------------------------------------------
# Example programs, in Fortran.

FDEMOS= x01f$E x02f$E x03f$E x04f$E x05f$E x06f$E x07f$E x08f$E x09f$E \
	x10f$E x11f$E x12f$E x13f$E x16f$E

fdemos:	$(FDEMOS)

x01f$O: x01f.f
	$(F77) $(F77_FLAGS) x01f.f

x01f$E:	$(PLLIBS) x01f$O
	$(LDF) $(LDF_FLAGS) x01f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x02f$O: x02f.f
	$(F77) $(F77_FLAGS) x02f.f

x02f$E:	$(PLLIBS) x02f$O
	$(LDF) $(LDF_FLAGS) x02f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x03f$O: x03f.f
	$(F77) $(F77_FLAGS) x03f.f

x03f$E:	$(PLLIBS) x03f$O
	$(LDF) $(LDF_FLAGS) x03f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x04f$O: x04f.f
	$(F77) $(F77_FLAGS) x04f.f

x04f$E:	$(PLLIBS) x04f$O
	$(LDF) $(LDF_FLAGS) x04f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x05f$O: x05f.f
	$(F77) $(F77_FLAGS) x05f.f

x05f$E:	$(PLLIBS) x05f$O
	$(LDF) $(LDF_FLAGS) x05f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x06f$O: x06f.f
	$(F77) $(F77_FLAGS) x06f.f

x06f$E:	$(PLLIBS) x06f$O
	$(LDF) $(LDF_FLAGS) x06f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x07f$O: x07f.f
	$(F77) $(F77_FLAGS) x07f.f

x07f$E:	$(PLLIBS) x07f$O
	$(LDF) $(LDF_FLAGS) x07f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x08f$O: x08f.f
	$(F77) $(F77_FLAGS) x08f.f

x08f$E:	$(PLLIBS) x08f$O
	$(LDF) $(LDF_FLAGS) x08f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x09f$O: x09f.f
	$(F77) $(F77_FLAGS) x09f.f

x09f$E:	$(PLLIBS) x09f$O
	$(LDF) $(LDF_FLAGS) x09f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x10f$O: x10f.f
	$(F77) $(F77_FLAGS) x10f.f

x10f$E:	$(PLLIBS) x10f$O
	$(LDF) $(LDF_FLAGS) x10f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x11f$O: x11f.f
	$(F77) $(F77_FLAGS) x11f.f

x11f$E:	$(PLLIBS) x11f$O
	$(LDF) $(LDF_FLAGS) x11f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x12f$O: x12f.f
	$(F77) $(F77_FLAGS) x12f.f

x12f$E:	$(PLLIBS) x12f$O
	$(LDF) $(LDF_FLAGS) x12f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x13f$O: x13f.f
	$(F77) $(F77_FLAGS) x13f.f

x13f$E:	$(PLLIBS) x13f$O
	$(LDF) $(LDF_FLAGS) x13f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

x16f$O: x16f.f
	$(F77) $(F77_FLAGS) x16f.f

x16f$E:	$(PLLIBS) x16f$O
	$(LDF) $(LDF_FLAGS) x16f$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

# Convenience rules for testing.

bugf$O:	bugf.f
	$(F77) $(F77_FLAGS) bugf.f

bugf$E:	$(PLLIBS) bugf$O
	$(LDF) $(LDF_FLAGS) bugf$O \
	       $(PLLIB_LDF) $(TO) $@ $(LDF_PATH) $(LDF_LIBS) $(DEMOS_RPATH)

# -----------------------------------------------------------------------------
# TK example programs.

TKDEMOS = xtk01$E xtk02$E xtk04$E

tkdemos: $(TKDEMOS)

xtk01$O: xtk01.c
	$(CC) $(CC_FLAGS_DEMOS) xtk01.c

xtk01$E:  $(PLLIBS) xtk01$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) xtk01$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

xtk02$O: xtk02.c
	$(CC) $(CC_FLAGS_DEMOS) xtk02.c

xtk02$E:  $(PLLIBS) xtk02$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) xtk02$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

xtk04$O: xtk04.c
	$(CC) $(CC_FLAGS_DEMOS) xtk04.c

xtk04$E:  $(PLLIBS) xtk04$O
	$(LDC) $(LDC_FLAGS) $(STARTUP) xtk04$O \
	       $(PLLIB_LDC) $(TO) $@ $(LDC_LIBS) $(DEMOS_RPATH)

# -----------------------------------------------------------------------------
# C++ example programs.

CXXDEMOS = x01cc$E

cxxdemos: $(CXXDEMOS)

x01cc$O: x01cc.cc
	$(CXX) $(CXX_FLAGS_DEMOS) x01cc.cc

x01cc$E:  $(PLLIBS) x01cc$O
	$(LDCXX) $(LDCXX_FLAGS) $(STARTUP) x01cc$O \
	       	$(PLLIB_LDCXX) $(TO) $@ $(LDCXX_LIBS) $(DEMOS_RPATH)

# -*-makefile-*----------------------------------------------------------------
# $Id: install.in,v 1.45 2002/01/29 06:45:16 airwin Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 14-Jul-1994
#
# Make assignments and targets for installation under Unix.
#
# It is recommended that you use a dedicated directory such as
# /usr/local/plplot (read the FAQ on this topic).  The install directory
# will be created if necessary, as will all required subdirectories.
#
# If support for <pkg> is not included, $(<PKG>_INSTALL) will be null.
#
# If a shared library was built, rebuild executables before installing.
# -----------------------------------------------------------------------------

# TCL must appear before TK in this list because symlinks installed by
# TK are decided by the existence of the x??.tcl files installed by TCL.

install: install_lib \
	$(INSTALL_F77) \
	$(INSTALL_PYTHON) \
	$(INSTALL_JAVA) \
	$(INSTALL_TCL) \
	$(INSTALL_TK) \
	$(INSTALL_CXX) \
	$(INSTALL_OCTAVE) \
	install_demos \
	install_drivers \
	install_utils

install_demos:
	@-if test ! -d $(DEMOS_DIR); then mkdir -p $(DEMOS_DIR); fi; \
	  if test ! -d $(DEMOS_DIR)/c; then mkdir -p $(DEMOS_DIR)/c; fi; \
	  $(CP) Makedemo $(DEMOS_DIR)/Makefile; \
	  $(CP) ../test/test_*.sh plplot-test.sh $(DEMOS_DIR); \
	  chmod a+x $(DEMOS_DIR)/plplot-test.sh; \
	  $(LN) ../Makefile $(DEMOS_DIR)/c; \
	  cd $(top_srcdir)/examples/c; \
	  $(CP) *.c $(DEMOS_DIR)/c; \
	  $(CP) *.h $(INCLUDE_DIR)

install_plrender:
	@-if test $(SHARED) = 1; then \
	  $(LDC) $(LDC_FLAGS) plrender$O $(LIB_INSTALL) \
		-o plrender$E $(LDC_LIBS) $(INSTALL_RPATH); \
	  fi; \
	  strip plrender$E; \
	  $(CP) plrender$E $(BIN_DIR)

install_pltek:
	@-strip pltek$E; $(CP) pltek$E $(BIN_DIR)

install_plplot_config:
	 @$(CP) plplot-config $(BIN_DIR); \
	 chmod a+x $(BIN_DIR)/plplot-config

# Install the dynamically loadable drivers and the drivers database,
# if any.
install_drivers:
	@-if test -d drivers; then \
	      if test ! -d $(DATA_DIR)/../drivers; then mkdir -p $(DATA_DIR)/../drivers; fi; \
	      $(CP) drivers/* $(DATA_DIR)/../drivers; \
	  fi

install_utils: install_plrender install_pltek install_plplot_config

LP=lpr
# -*-makefile-*----------------------------------------------------------------
# $Id: inst_lib.in,v 1.20 2001/08/22 23:03:43 furnish Exp $
# Maurice LeBrun
# IFS, University of Texas at Austin
# 24-Jul-1994
#
# Install procedure for PLplot library.
# -----------------------------------------------------------------------------

install_dirs:
	@-if test ! -d $(INCLUDE_DIR); then mkdir -p $(INCLUDE_DIR); fi; \
	  if test ! -d $(LIB_DIR); then mkdir -p $(LIB_DIR); fi; \
	  if test ! -d $(DATA_DIR); then mkdir -p $(DATA_DIR); fi; \
	  if test ! -d $(DOC_DIR); then mkdir -p $(DOC_DIR); fi; \
	  if test ! -d $(BIN_DIR); then mkdir -p $(BIN_DIR); fi; \
	  if test ! -d $(INFO_DIR); then mkdir -p $(INFO_DIR); fi

install_fonts:
	@-cd $(top_srcdir)/lib; $(CP) *.fnt *.map $(DATA_DIR)

install_libbase:
	@-( cd $(LIB_DIR); $(RM) $(PLLINKS) ) ; \
	  $(CP) $(PLLIB_BASE)* $(LIB_DIR); \
	  if test -r $(PLLIB_BASE)$(LIB_TAG)$A; then \
	     $(RANLIB) $(LIB_DIR)/$(PLLIB_BASE)$(LIB_TAG)$A; \
	  fi

install_textfiles:
	@-cd $(top_srcdir); \
	  $(CP) README NEWS CHANGES Copyright COPYING.LIB FAQ ToDo mklinks \
		$(DOC_DIR); \
	  if test ! -f $(DOC_DIR)/README.local; then \
	      $(CP) $(top_srcdir)/doc/README.local $(DOC_DIR); \
	  fi

install_scriptfiles:
	@-cd $(top_srcdir)/scripts; $(CP) pl* pstex2eps $(BIN_DIR)

install_includes:
	@-$(CP) plConfig.h plDevs.h $(INCLUDE_DIR); \
	  cd $(top_srcdir)/include; \
	  $(CP) plplotP.h plplot.h plxwd.h plevent.h plstrm.h pdf.h \
	     pldebug.h drivers.h disptab.h $(INCLUDE_DIR)

install_lib: install_dirs install_fonts install_libbase \
	$(INSTALL_MATLIB) $(INSTALL_CXXLIB) \
	install_textfiles install_scriptfiles install_includes \
	$(INSTALL_MAT)

# -*-makefile-*----------------------------------------------------------------
# $Id: misc.in,v 1.21 2002/02/08 00:21:47 jcard Exp $
#
# Maurice LeBrun
# IFS, University of Texas at Austin
# 22-Jul-1994
#
# Miscellaneous targets.
# -----------------------------------------------------------------------------

# Cleanup
# Get rid of tmp directories, then tmp files, then m4-generated files, then
# configure-time generated symlinks in tk/examples.

clean:
	-$(RM) -rf shared plplot java drivers ti_files python_dynamic \
	plplot_octave_txt tmp_stub massage plplot_octave.*
	find . ! -name . \( -newer .plcfg -o -type l \) -exec rm {} \;
	for filename in $(top_srcdir)/bindings/f77/*.fm4; \
	do  \
	ffilename=`echo $$filename | sed 's/\.fm4$$/.f/'`; \
	$(RM) $$ffilename ; \
	done
	for filename in $(top_srcdir)/examples/f77/*.fm4; \
	do  \
	ffilename=`echo $$filename | sed 's/\.fm4$$/.f/'`; \
	$(RM) $$ffilename ; \
	done
	for filename in $(top_srcdir)/examples/tcl/x??.tcl; \
	do  \
	ffilename=`echo $$filename | sed 's?examples/tcl?examples/tk?'`; \
	$(RM) $$ffilename ; \
	done
	$(RM) .plcfg

distclean: clean

# Autogeneration of dependencies.  Use gcc -MM because X11's "makedepend"
# includes system headers, and that really sucks.  Generate dependencies
# for /all/ files here.

depend:
	gcc -MM -I. *.c *.cc | sed 's/\.o/\$$O/' >objs.in
	@echo "Rerun configure for the new dependencies to take effect"

# -----------------------------------------------------------------------------
# Auto-generated dependency list follows (warning: it's ugly).

# -*-makefile-*----------------------------------------------------------------
# $Id: autodeps.in,v 1.1 2002/02/26 19:07:15 furnish Exp $
#
# Pull in the dependencies.
# -----------------------------------------------------------------------------

ifeq ($(automatic_deps),yes)
-include .d.* shared/.d.*
else
include objs.in
endif

