#############################################################################
#       $Id: GNUmakefile,v 1.53 1996/05/07 16:49:11 rich Exp $
# $Revision: 1.53 $
#     $Date: 1996/05/07 16:49:11 $
#   $Author: rich $
#    $State: Exp $
#   $Locker:  $
#
# PROJECT:	TCA
#
# FILE:		GNUmakefile
#		Based on Erebus prototypical Makefile
#		Makefile.proto,v 1.1 1992/06/16 22:50:21 jwest Exp 
#
# DESCRIPTION:
# Makes the tca libraries and central server.
#
# EXPORTS:
#	The following targets are available as part of Makefile.std:
#		all bins libs privs objs
#		clean install
#		lint depend
#
# HISTORY:
#
# $Log: GNUmakefile,v $
# Revision 1.53  1996/05/07  16:49:11  rich
# Changes for clisp.
#
# Revision 1.52  1996/02/12  00:53:48  rich
# Get VX works compile to work with GNUmakefiles.
#
# Revision 1.51  1996/02/11  21:34:49  rich
# Updated GNUmakefiles for faster complilation.  Use FAST_COMPILE=1 for
# routine recompiles.
#
# Revision 1.50  1996/02/07  00:27:30  rich
# Add prefix to VERSION_DATE and COMMIT_DATE.
#
# Revision 1.49  1996/02/01  04:03:31  rich
# Generalized updateVersion and added recursion.
#
# Revision 1.48  1996/01/12  00:53:11  rich
# Simplified GNUmakefiles.  Fixed some dbmalloc problems.
#
# Revision 1.47  1996/01/10  03:16:07  rich
# Fixed libtca_lisp.a to work with dbmalloc.  Added central commands to
# show resource state and to unlock locked resouces.  Fixed a bug where
# dispatches were not freed when handlers were cleared. Reset errno variable.
#
# Revision 1.46  1996/01/05  16:30:55  rich
# Added windows NT port.
#
# Revision 1.45  1995/12/21  19:17:30  reids
# For safety's sake, copy strings when registering messages, handlers and
#    when connecting.
#
# Revision 1.44  1995/12/17  20:21:01  rich
# Have free routines set pointers to NULL.
# Removed old makefiles.
#
# Revision 1.43  1995/12/15  01:22:56  rich
# Moved Makefile to Makefile.generic to encourage people to use
# GNUmakefile.
# Fixed a memory leak when a module is closed and some other small fixes.
#
# Revision 1.42  1995/10/29  18:26:19  rich
# Initial creation of 8.3. Added changes made after 8.2 branch was
# created. These mostly have to do with context switching.
#
# Revision 1.41.2.1  1995/11/19  22:24:03  rich
# Fixed some problems with the old Makefiles.
#
# Revision 1.41  1995/10/07  19:06:51  rich
# Pre-alpha release of tca-8.2.
# Added PROJECT_DIR. Added tcaWillListen.
# Only transmit broadcast messages when there is a handler to receive them.
# All system messages now start with "tca_".  Old messages are also supported.
#
# Revision 1.40  1995/07/10  16:16:31  rich
# Interm save.
#
# Revision 1.39  1995/07/08  18:24:35  rich
# Change all /afs/cs to /afs/cs.cmu.edu to get ride of conflict problems.
#
# Revision 1.38  1995/07/08  17:50:46  rich
# Linux Changes.  Also added GNUmakefile.defs.
#
# Revision 1.37  1995/07/06  21:15:32  rich
# Solaris and Linux changes.
#
# Revision 1.36  1995/06/14  03:21:17  rich
# Added DBMALLOC_DIR.
# More support for DOS.  Fixed some problems with direct connections.
#
# Revision 1.35  1995/05/31  19:34:49  rich
# Fixed problem with reply data being freed early from replys.
# Initial work on getting the PC version to work.
#
# Revision 1.34  1995/04/09  20:30:01  rich
# Added /usr/local/include and /usr/local/lib to the paths for compiling
# for sunOS machines. (Support for new vendor OS).
# Create a tca directory in /tmp and put the socket in there so others can
# delete dead sockets.  The /tmp directory has the sticky bit set so you
# can't delete files even if you have write permission on the directory.
# Fixes to libc.h to use the new declarations in the gcc header files and
# avoid problems with dbmalloc.
#
# Revision 1.33  1995/04/07  05:02:35  rich
# Fixed GNUmakefiles to find the release directory.
# Cleaned up libc.h file for sgi and vxworks.  Moved all system includes
# into libc.h
# Got direct queries to work.
# Fixed problem in allocating/initializing generic mats.
# The direct flag (-c) now mostly works.  Connect message has been extended to
# indicate when direct connections are the default.
# Problem with failures on sunOS machines.
# Fixed problem where tcaError would not print out its message if logging had
# not been initialized.
# Fixed another memory problem in modVar.c.
# Fixed problems found in by sgi cc compiler.  Many type problems.
#
# Revision 1.32  1995/04/04  19:41:40  rich
# Added sgi support.
# Split low level com routines out to be used in devUtils.
# Improved some error messages.
# Added central switch to default to direct connections.  Does not work yet.
# Fixed the vectorization code.
#
# Revision 1.31  1995/03/30  15:42:17  rich
# DBMALLOC works.  To use "gmake -k -w DBMALLOC=DBMALLOC install"
# Added simple list of strings data structure that can be passed via tca
# messages.
# Use the string list to maintain a global variable of messages with taps.
# Tapped messages are not sent via direct connections.
# Implemented code to vectorize data to be sent so that it does not have
# to be copied.  Currently, only flat, packed data structures are
# vectored.  This can now be easily extended.
# Changed Boolean -> BOOLEAN for consistency and to avoid conflicts with x11.
# Fixed bug were central would try and free the "***New Module***" and
# "*** Unkown Host***" strings when a module crashed on startup.
# Fixed a bug reported by Jay Gowdy where the code to find the size of a
# variable lenght array would access already freed data when called from
# tcaFreeData.
#
# Revision 1.30  1995/03/28  01:22:30  rich
# Moved some logging functions to a seperate file so they can be used by
# modules to determine if logging is active.
#
# Revision 1.29  1995/03/28  01:14:07  rich
# - Added ability to log data with direct connections.  Also fixed some
# problems with global variables. It now uses broadcasts for watching variables.
# - Added preliminary memory recovery routines to handle out of memory
# conditions.  It currently purges items from resource queues.  Needs to
# be tested.
# - If the CENTRALHOST environment variable is not set, try the current
# host.
# - Fixed a problem with central registered messages that caused the parsed
# formatters to be lost.
# - Added const declarations where needed to the prototypes in tca.h.
# - tcaGetConnections: Get the fd_set.  Needed for direct connections.
# - Added tcaExecute and tcaExecuteWithConstraints.  Can "execute" a goal
#   or command.
# - tcaPreloadMessage: Preload the definition of a message from the
#   central server.
#
# Revision 1.28  1995/03/19  19:39:14  rich
# Implemented direct connections using tcaDirectResouce call.
# Also made the basics.h file a module include.
# Changed class in the interval structure to be interval_class to avoid a
# conflict with C++.
#
# Revision 1.27  1995/03/18  15:10:51  rich
# Fixed updateVersion script so it can be run from any directory.
#
# Revision 1.26  1995/03/16  20:17:31  rich
# Had version number keywords incorrect.
#
# Revision 1.25  1995/03/16  18:05:04  rich
# Merged in changes to the 7.9 branch.
# Changed the VERSION_ to TCA_VERSION_
#
# Revision 1.24  1995/01/30  16:17:33  rich
# Added indications of message byte order and alignment to the message
# header in the upper two bytes of the classID.
# Now the receiver translates the byte order but must receive data in
# "PACKED" alignment.
# Made -gstabs come after -g for i386_mach machines so the debugger will work.
#
# Revision 1.23  1995/01/25  21:44:07  rich
# Changing version to 8.0 to start developement.
#
# Revision 1.22  1995/01/25  20:55:00  rich
# Need to change sun4c to SunOS for os dependent binaries.
#
# Revision 1.21  1995/01/25  19:38:24  rich
# Removed defns.h.  Placed needed definitions in basics.h.
#
# Revision 1.20  1995/01/25  00:23:39  rich
# Formatting changes from 7.8 -> 7.9.
#
# Revision 1.19  1995/01/18  22:39:19  rich
# TCA 7.9: Speed improvements.
# Use unix sockets for communication on the same machine.
# Eliminate copying.
# Optimize loop for arrays, especially simple, primitive arrays.
# Optimize the buffer size.
#
# Revision 1.18  1994/11/03  06:48:03  rich
# Fixed some problems with MACH machines.
#
# Revision 1.17  1994/11/02  21:33:37  rich
# Now works for linux machines (i486).
# Got afs to work on alpha (and hopefully other vendor OS's)
# Added generic Makefile.
# Made libc.h and tcaMatrix.h module includes.
# Reduced the size of libc.h by using more system includes.
#
# Revision 1.16  1994/06/07  02:30:17  rich
# Include the top level README and other files in the tarfile.
# Include extra header infomation to get rid of warnings.
#
# Revision 1.15  1994/05/31  13:40:33  reids
# Deadlock and Fairness: fixed a bug that would cause deadlock if a module
# tried to lock/reserve itself from within a message handler; fixed another
# bug that could cause messages to be delayed indefinitely if "limit pending"
# was used.
#
# Revision 1.14  1994/05/31  03:23:37  rich
# Removed CFLAGS_sun4.
# Removed cfree and bzero from mem routines.
# Set zero wait on both sides of the pipe.  Can connect to host using inet
# number.
#
# Revision 1.13  1994/05/25  05:05:23  rich
# Changed cflags back to include -O
#
# Revision 1.12  1994/05/25  04:56:50  rich
# Defined macros for registering simple messages and handlers at once.
# Added function to ignore logging for all messages associated with a
# global variable.
# Moved module global variable routines to a new file so they are not
# included in the .sa library file.  Gets better code sharing and lets you
# debug these routines.
# Added code to force the module variables to be re-initialized after the
# server goes down.
# tcaClose now will not crash if the server is down and frees some module
# memory.
# The command line flag "-u" turns off the simple user interface.
# Added routines to free hash tables and id tables.
#
# Revision 1.11  1994/05/20  23:36:08  rich
# Fixed release date.  Removed centralSuccess from the delay handler.
# Added DEPEND_PREFIX for creating dependencies for object files in subdirs.
#
# Revision 1.10  1994/05/17  23:14:58  rich
# Added global variables and associated routines.
# Added some error checking.  The central connection is now set to -1
# rather than zero to prevent tca messages from being send to stdout.
# Now compiles on the sgi machines.  Still need to have the endian and
# alignment figured out automatically.
#
# Revision 1.9  1994/05/11  01:57:03  rich
# Now set an invalid tcaServerGlobal (a socket fd) to -1 rather than 0
# which is stdout.
# Added checks to make sure tcaServerGlobal is a valid socket before
# sending messages or waiting for messages.
#
# Revision 1.8  1994/05/06  07:40:12  rich
# Create both tar.gz and tar.Z ftp files.
#
# Revision 1.7  1994/05/06  07:12:06  rich
# Fixed makefile so it includes centralIO.[hc].
# Updated INSTALL for systems without gunzip and gmake.
#
# Revision 1.6  1994/05/06  05:15:41  rich
# Removed duplicate log entries.
#
# Revision 1.5  1994/05/06  05:00:10  rich
# Forgot the .gz on the ftp file.
#
# Revision 1.4  1994/05/06  04:46:50  rich
# Put central io routines in a new file.
# Fixed GNUmakefile.
#
# Revision 1.3  1994/05/05  00:54:17  rich
# Get dependency correct.
#
# Revision 1.2  1994/05/05  00:49:32  rich
# Removed duplicate includes.
#
# Revision 1.1  1994/05/05  00:45:45  rich
# Added a gmake makefile GNUmakefile so that the system can be easily
# compiled on different machines.
# Can now create the targets: tarfile and ftp for creating versions for export.
#
# Fixed a number of places were tcaExitHnd was not expected to return.
# Set the tcaSeverGlobal to 0 when the socket is closed.
#
# Revision 1.26  1994/04/29  02:37:30  rich
# Shared library code should use -fpic rather than -fPIC.
#
# Revision 1.25  1994/04/28  16:16:22  reids
# Changes in TCA Version 7.6:
#  1) New functions: tcaIgnoreLogging and tcaResumeLogging
#  2) Code for MacIntosh (MPW) version of TCA
#
# Revision 1.24  1994/04/26  16:23:37  rich
# Now you can register an exit handler before anything else and it will
# get called if connecting to central fails.
# Also added code to handle pipe breaks during writes.
#
# Revision 1.23  1994/04/16  21:20:57  rich
# Forgot to turn optimization back on.
#
# Revision 1.22  1994/04/16  19:42:33  rich
# First release of TCA for the DEC alpha.
# Changes were needed because longs are 64 bits.
# Fixed alignment assumption in the data message format.
# Fixed the way offsets are calculated for variable length arrays.  This
# was a problem even without 64 bit longs and pointers.
#
# Added the commit date to the version information printed out with the -v
# option.
#
# Now uses standard defines for byte order
# (BYTE_ORDER = BIG_ENDIAN, LITTLE_ENDIAN or PDP_ENDIAN)
#
# Defined alignment types: ALIGN_INT ALINE_LONGEST and ALIGN_WORD.
#
# *** WARNING ***
# sending longs between alphas and non-alpha machines will probably not work.
# *** WARNING ***
#
# Revision 1.21  1994/04/15  17:09:59  reids
# Changes to support vxWorks version of TCA 7.5
#
# Revision 1.20  1994/04/04  16:01:21  reids
# Fixed the way data transfer occurred from/to big and little Endian machines
#
# Revision 1.19  1994/03/28  02:23:08  rich
# parseFmttrs needs to be in the server objects and not the module objects.
#
# Revision 1.18  1994/03/27  22:50:34  rich
# Fixed problem with lisp version not working because of some compiler
# flags used for the shared library version.
# TCA now compiles for alphas, but does not run.
#
# Revision 1.17  1994/01/31  19:26:28  reids
# Oops.  Made a mistake.  Changing things back again
#
# Revision 1.16  1994/01/31  19:09:09  reids
# makefile used to put obj, lib, bin, etc. under ./; it is now put under ../
#
# Revision 1.15  1994/01/31  18:28:08  reids
# Several major changes (and some minor ones)
# 1. tcaFreeData and tcaFreeReply now work even if the data or message format
#    is NULL
# 2. Using the "-t" option in central, message taps are added as a child of the
#    task tree node that was tapped.
# 3. Named formatters are now expanded only when needed
# For more details, see ../doc/tca-7-4.release.notes
#
# Revision 1.14  1994/01/18  17:08:20  rich
# Need to create non-dynamic library for suns for static linking.
#
# Revision 1.13  1994/01/06  21:50:01  rich
# Updated the makefile to create the SunOS dynamic library with the right
# version number.
#
# Revision 1.12  1993/12/14  17:34:10  rich
# Changed getMGlobal to GET_M_GLOBAL and changed getSGlobal to
# GET_S_GLOBAL to conform to Chris' software standards.
#
# Patched problem with connecting between machines with different byte
# orders.  The real fix requires changing the way formats are stored.
# Searching for structural similar formats does not guarantee that you
# find the right format.
#
# Revision 1.11  1993/12/01  18:04:00  rich
# Fixed a problem with the port number being double converted to network
# byte order.
# Some general cleanup.
#
# Revision 1.10  1993/11/22  01:53:13  rich
# Fixed "make clean" and the makefile cflags_sun4 for the sun4_mach
# architecture.
#
# Revision 1.9  1993/11/21  20:18:22  rich
# Added shared library for sun4c_411 Sunos machines.
# Added install to the makefile.
# Fixed problems with global variables.
#
#
# Modified it to take advantage of the @sys expansion for multiple
# architectures.
# RTG.
#
#############################################################################

#############################################################################
# Module Configuration Macros
#############################################################################

PROJECT_DIR	= /afs/cs/project/TCA/release/alpha

INSTALL_DIR	= ..
ifndef BASE_DIR
BASE_DIR	:= $(shell cd $(INSTALL_DIR);/bin/pwd)
endif
MODULE_DIR	= src
PROJECT		= tca
MODULE		= tca
SUBDIRS		=
DEPEND_FILE	= GNUmakefile.$(THIS_MACHINE)
DEPEND_PREFIX	= $(ODIR)/ $(LODIR)/ $(SODIR)/ $(VODIR)/
VERSION_FILE	= tcaInternal.h
VERSION_PREFIX	= TCA

#############################################################################
# Where are the standard files?
#############################################################################

ifndef FAST_COMPILE
PWD 	:= $(shell /bin/pwd)
endif

ifndef STD_FILE
STD_FILE := $(shell ls $(BASE_DIR)/etc/GNUmakefile.std | grep -v "not found")
ifeq ($(STD_FILE),)
STD_FILE := $(PROJECT_DIR)/etc/GNUmakefile.std
endif
DEFS_FILE := $(shell ls $(BASE_DIR)/etc/GNUmakefile.defs | grep -v "not found")
ifeq ($(DEFS_FILE),)
DEFS_FILE := $(PROJECT_DIR)/etc/GNUmakefile.defs
endif
endif

##########
# Include standard definitions
##########

include $(DEFS_FILE)

##########
# Override defaults here.
##########

##########
# File Definition Macros.  Deletion of generated files assumed
#    to be o.k.  Source files will never be deleted.
##########

# Generated files - installed
PUBLIC_BINS_SunOS	= central.static
PUBLIC_BINS		= central  $(PUBLIC_BINS_$(THIS_OS))
#Uncomment the next line if you want to build the lisp library.
PUBLIC_LIBS_LISP	= libtca_lisp.a
PUBLIC_LIBS_Solaris	= libtca.so.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR) \
			  libtca.sa.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR)
PUBLIC_LIBS_SunOS	= libtca.so.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR) \
			  libtca.sa.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR) \
			  $(PUBLIC_LIBS_LISP)
PUBLIC_LIBS_linux	= libtca.so.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR) \
			  libtca.sa.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR)
PUBLIC_LIBS_RISC	= $(PUBLIC_LIBS_LISP)
PUBLIC_LIBS		= libtca.a $(PUBLIC_LIBS_$(THIS_OS)) \
			$(PUBLIC_LIBS_$(THIS_MACHINE))
PUBLIC_LINTS		= 

MODULE_LIBS		= 
MODULE_LINTS		= 

# Source files - installed
PUBLIC_INCS		= tca.h
PUBLIC_MANS		= 
PUBLIC_DOCS		= 

MODULE_INCS		= tcaMatrix.h libc.h basics.h com.h centralMsg.h \
			  tcaInternal.h strList.h list.h
MODULE_DOCS		= 

INCS			= $(MODULE_INCS) $(PUBLIC_INCS)

# Generated files - not installed
PRIVS	= sizesTest

MODOBJS = list.o behaviors.o tcModError.o \
	datamsg.o formatters.o hash.o \
	idtable.o key.o monMod.o \
	primFmttrs.o reg.o resMod.o \
	sendMsg.o tskTreeMod.o tcaMatrix.o \
	tcaMem.o tcaRef.o tplModule.o \
	msgTapMod.o excepMod.o comModule.o com.o\
	globalM.o globalMUtil.o modVar.o \
	modLogging.o strList.o

MODDATA = globalM.o

MODULEOBJS = $(patsubst %,$(ODIR)/%,$(MODOBJS))
SHAREDOBJS = $(patsubst %,$(SODIR)/%,$(MODOBJS))
MODULEDATA = $(patsubst %,$(ODIR)/%,$(MODDATA))

LISPOBJS_DBMALLOC = $(DBMALLOC_DIR)/lib/libdbmalloc.a

LISPOBJS = $(patsubst %,$(LODIR)/%,$(MODOBJS))

VXLIBOBJS = $(patsubst %,$(VODIR)/%,$(MODOBJS))

SERVOBJS = comServer.o dispatch.o lex.o \
	recvMsg.o queue.o res.o \
	tplConstr.o tms.o cells.o qlattice.o \
	rules.o mon.o tcerror.o logging.o \
	taskTree.o msgTap.o  printData.o\
	exception.o globalS.o parseFmttrs.o centralIO.o globalVar.o

SERVEROBJS = $(patsubst %,$(ODIR)/%,$(SERVOBJS))

VXSERVEROBJS = $(patsubst %,$(VODIR)/%,$(SERVOBJS))

OBJS	= $(MODULEOBJS) $(SHAREDOBJS) $(SERVEROBJS) $(LISPOBJS) \
	  $(ODIR)/central.o $(ODIR)/sizesTest.o $(VXLIBOBJS) $(VXSERVEROBJS)

# Source files - not installed

MODSRCS =  list.c behaviors.c tcModError.c \
         datamsg.c formatters.c hash.c \
         idtable.c key.c monMod.c \
         primFmttrs.c reg.c resMod.c sendMsg.c \
         tskTreeMod.c tcaMatrix.c \
         tcaMem.c tcaRef.c tplModule.c msgTapMod.c \
         excepMod.c comModule.c com.c globalM.c globalMUtil.c globalVar.c\
	 modVar.c modLogging.c strList.c

SERVSRCS = comServer.c dispatch.c lex.c \
        recvMsg.c queue.c res.c \
        tplConstr.c tms.c cells.c qlattice.c \
        rules.c mon.c tcerror.c logging.c \
        taskTree.c msgTap.c exception.c globalS.c \
	parseFmttrs.c central.c centralIO.c printData.c 

SRCS            = $(MODSRCS) $(SERVSRCS) sizesTest.c

PRIVATE_INCS	= behaviors.h cells.h comModule.h \
	comServer.h datamsg.h dispatch.h exception.h formatters.h \
	globalM.h globalS.h hash.h idtable.h key.h lex.h \
	logging.h mon.h monMod.h msgTap.h parseFmttrs.h primFmttrs.h \
	printData.h qlattice.h queue.h recvMsg.h reg.h res.h resMod.h \
	rules.h sendMsg.h taskTree.h \
	tcaMem.h tcaRef.h tcerror.h tms.h tplConstr.h centralIO.h \
	globalVar.h modVar.h modLogging.h

MISC	= GNUmakefile README INSTALL makefile.NeXT \
	makefile.next_mach30 makefile.vx Makefile.generic Makefile.bcc\
	windowNT.mak

##########
# Default Target
##########

all:: srcs libs bins privs

# The vx works compiler constants are in etc/GNUmakefile.defs.
vx:  $(VODIR)/.force $(LDIR)/.force $(BDIR)/.force \
	$(PUBLIC_LIB_DIR)/libtca_vx.a $(PUBLIC_BIN_DIR)/central_vx

##########
# User Defined Targets
##########

# Define rules for all files listed in BINS, LIBS, and LINTS in this section.
# Example executable, object, library, and combined objects are shown below:
#
#  $(BDIR)/sample: file1.o file2.o $(LIBDEP)
#	$(LINK.c) -o $@ file1.o file2.o $(LIBRARIES)
#
#  $(ODIR)/alternateName.o: file1.c
#	$(COMPILE.c) -o $@ file1.c
#
#  $(LDIR)/libsample.a: file1.o file2.o
#	-$(RM) $@
#	$(AR) $(ARFLAGS) $@ file1.o file2.o
#	$(RANLIB) $@
#
#  $(ODIR)/combined.o: $(ODIR)/part1.o $(ODIR)/part2.o
#	$(LD) -r -o $@ $(ODIR)/part1.o $(ODIR)/part2.o; chmod a-x $@

$(BDIR)/central: $(ODIR)/central.o $(SERVEROBJS) $(LIBDEP)
	$(LINK.c) -o $@ $(ODIR)/central.o $(SERVEROBJS) \
		$(LIBRARIES) $(DYN_LIBRARIES)

$(PUBLIC_BIN_DIR)/central: $(ODIR)/central.o $(SERVEROBJS) $(LIBDEP)

$(BDIR)/central.static: $(ODIR)/central.o $(SERVEROBJS) $(LIBDEP)
	$(LINK.c) -static -o $@ $(ODIR)/central.o $(SERVEROBJS) $(LIBRARIES)

$(PUBLIC_BIN_DIR)/central.static: $(ODIR)/central.o $(SERVEROBJS) $(LIBDEP)

$(BDIR)/central_vx: $(VODIR)/central.o $(VXSERVEROBJS) $(LDIR)/libtca_vx.a 
	$(LINK.vx) -o $@ $(VODIR)/central.o $(VXSERVEROBJS) $(LDIR)/libtca_vx.a

$(PUBLIC_BIN_DIR)/central_vx: $(BDIR)/central_vx

$(LDIR)/libtca.a: $(MODULEOBJS)
	$(RM) $@
	$(AR) $(ARFLAGS) $@ $(MODULEOBJS)
	$(RANLIB) $@

$(PUBLIC_LIB_DIR)/libtca.a: $(MODULEOBJS)

ifdef DBMALLOC
$(LDIR)/libtca_lisp.a: $(LISPOBJS)
	$(RM) $@
	- mkdir dbmallocObj
	cd dbmallocObj; $(AR) x $(DBMALLOC_DIR)/lib/libdbmalloc.a
	$(AR) $(ARFLAGS) $@ $(wildcard dbmallocObj/*.o) $(LISPOBJS)
	$(RANLIB) $@
else
$(LDIR)/libtca_lisp.a: $(LISPOBJS)
	$(RM) $@
	$(AR) $(ARFLAGS) $@ $(LISPOBJS)
	$(RANLIB) $@
endif

$(PUBLIC_LIB_DIR)/libtca_lisp.a: $(LISPOBJS)

$(LDIR)/libtca_vx.a: $(VXLIBOBJS)
	rm -f $(LDIR)libtca_vx.a
	$(VX_AR) rvu $(LDIR)/libtca_vx.a $(VXLIBOBJS)
	$(VX_RANLIB) $(LDIR)/libtca_vx.a

$(PUBLIC_LIB_DIR)/libtca_vx.a: $(LDIR)/libtca_vx.a

$(LDIR)/libtca.so.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR): $(SHAREDOBJS)
	$(LD_SHARED) -o \
	$(LDIR)/libtca.so.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR) \
		$(SHAREDOBJS) $(LIB_PATH)

$(PUBLIC_LIB_DIR)/libtca.so.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR): $(SHAREDOBJS)

$(LDIR)/libtca.sa.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR): $(MODULEDATA)
	$(RM) $@
	$(AR) $(ARFLAGS) $@ $(MODULEDATA)
	$(RANLIB) $@

$(PUBLIC_LIB_DIR)/libtca.sa.$(TCA_VERSION_MAJOR).$(TCA_VERSION_MINOR): $(MODULEDATA)

$(BDIR)/sizesTest: $(ODIR)/sizesTest.o $(SERVEROBJS) $(LIBDEP)
	$(LINK.c) -o $@ $(ODIR)/sizesTest.o  $(SERVEROBJS) $(LIBRARIES) $(DYN_LIBRARIES)

# this dependency is used to update the version information.
$(ODIR)/centralIO.o: $(SRCS_ALL)

$(LODIR)/centralIO.o: $(SRCS_ALL)

$(VODIR)/centralIO.o: $(SRCS_ALL)

#
# Targets for building a release
#

#
# the lisp version of the code is special.
#

$(LODIR)/%.o: %.c
	$(COMPILE.c) -I$(LISP_INC_DIR) $(CFLAGS_LISP) -o $@ $<

#
# So is the version for the shared library.
#

$(SODIR)/%.o: %.c
	$(COMPILE.c) -fpic -o $@ $<

$(VODIR)/%.o: %.c
	$(COMPILE.vx) -o $@ $<

##########
# Include standard target definitions and RCS rules
##########

include $(STD_FILE)
