# -----------------------------------------------------------------------
# $Id: lib.in,v 1.1 1994/09/16 03:54:57 mjl 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.
# -----------------------------------------------------------------------

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

.f$O:
#	$(F77) $(F77_FLAGS) $*.f
	f2c -A $*.f
	$(CC) $(CC_FLAGS) $*.c
	del $*.c

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

PLLIBS = $(PLLIB_AR)

libs:	$(PLLIBS)

$(PLLIB_AR):	$(LIB_OBJS)
	-rm $(PLLIB_AR)
	@echo "Building archive library"
	$(ARLIB_BUILD) $(PLLIB_AR) $(ADD_DRIVERS_OBJ) @libfiles.tmp
	$(RANLIB) $(PLLIB_AR)

# -----------------------------------------------------------------------
# Sick hacks.
# -----------------------------------------------------------------------

# Needs to be compiled using K&R C.

tcpip$O:	plserver.h plplotTK.h plplotX.h plplotP.h plplot.h pdf.h \
		plstream.h tcpip.c
	$(OCC) $(CC_FLAGS) tcpip.c

# Optimizer under AIX 3.2.3 bogues out here.

xwin$O:		plplotP.h plplot.h drivers.h pdf.h plstream.h plplotX.h xwin.c
	$(CC) $(CC_FLAGS_XWIN) xwin.c

# Optimizer on SX-3 makes bogus code here.

sccont$O:	plstubs.h plplotP.h plplot.h sccont.c
	$(CC) $(CC_FLAGS_SCCONT) sccont.c

