# Generated automatically from Makefile.in by configure.
#************************************************************************
#*									*
#*	Copyright 1992,1993 by Motorola Mobile Data Division,		*
#*			       Bothell, WA				*
#*									*
#*	Motorola hereby grants permission to use, copy, modify and	*
#*	distribute  this software and its documentation for any		*
#*	purpose and without fee, provided that you retain this		*
#*	copyright notice in all copies.  Motorola makes no		*
#*	representations about the suitability of this software for any	*
#*	purpose.  Motorola provides this software ``as is'' without	*
#*	express or implied warranty.					*
#*									*
#************************************************************************
#
RCSid = $Header: /usr/local/source/coda_source/Tcl/src7.4/svipc/Makefile.in,v 1.6 2003/11/12 19:57:09 abbottd Exp $

#
# File: SVipc/Makefile
# Facility: Tcl System V IPC Support
# Author: Joe Kelsey
# Description:
# 	Create the enhanced libtcl.a including System V IPC support
#	(shared memory, semaphores and message queues).
#

# System configuration section, filled in by autoconf.

srcdir = .

CC = gcc

INSTALL = /usr/bin/install -c
INSTALL_PROG = ${INSTALL}  
INSTALL_DATA = ${INSTALL} -m 644

RANLIB = ranlib

DEFS =  -DLINUX=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRERROR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_STRDUP=1 -DHAVE_STRCASECMP=1 -DHAVE_UNISTD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_FCNTL_H=1 -DNO_STREAM_H=1 -DNO_UN_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_TOLOWER=1 -DHAVE_NTOHL=1 -DSTDC_HEADERS=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_FLOAT_H=1 -DHAVE_MALLOC_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MEMORY_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_WAIT_H=1 -DTIME_WITH_SYS_TIME=1 -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -DSVIPC_NO_UNION_SEMUN=1 -DTK_FILE_READ_PTR=1 
LIBS = 
XLIBS = -L/usr/X11R6/lib -lXpm -lXext -lXt -lX11
XINCS = -I/usr/X11R6/include

CCFLAGS = -O
LDFLAGS = -O

prefix = /usr/local/coda/2.5/common
exec_prefix = /usr/local/coda/2.5/Linux
bin_prefix =
lib_prefix =
man_prefix =

bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
incdir = $(prefix)/include
mandir = $(prefix)/man
man3dir = $(mandir)/man3
manndir = $(mandir)/mann

# End of system configuration.

SHELL = /bin/sh

TCL_VERSION = 7.4
TCLX_VERSION = 7.3a
TK_VERSION = 4.0

TCL_DIR = $(srcdir)/../tcl7.4
TCLLIB = $(TCL_DIR)/libtcl.a

TK_DIR = $(srcdir)/../tk4.0
TKLIB = $(TK_DIR)/libtk.a

TCLX_DIR = $(srcdir)/../tclX$(TCLX_VERSION)/tclmaster
TCLXSRC_DIR = $(TCLX_DIR)/src
TCLXINC_DIR = $(TCLX_DIR)/include
TCLXLIB_DIR = $(TCLX_DIR)/lib
TCLXLIB = $(TCLXLIB_DIR)/libtclx.a

TKX_DIR = $(srcdir)/../tclX$(TCLX_VERSION)/tkmaster
TKXSRC_DIR = $(TKX_DIR)/src
TKXINC_DIR = $(TKX_DIR)/include
TKXLIB_DIR = $(TKX_DIR)/lib
TKXLIB = $(TKXLIB_DIR)/libtkx.a

CPPFLAGS = -I$(srcdir) -I$(incdir)

CFLAGS = $(CPPFLAGS) $(CCFLAGS) $(DEFS)

# Things to make

PROGS = tclsh tcl wish wishx

SRCS = svipcInit.c svipcLink.c svipcMsg.c svipcSem.c svipcShm.c

OBJS = libsvipc.a(svipcInit.o) libsvipc.a(svipcLink.o) \
       libsvipc.a(svipcMsg.o) libsvipc.a(svipcSem.o) libsvipc.a(svipcShm.o)

MANFILES = man/linkvar.n man/msg.n man/sem.n man/shm.n man/shmacc.n \
	   man/svLinkVar.3 man/tclipc.n

TESTFILES = tests/msg.tcl tests/sem.tcl tests/shm.tcl

DISTDIRS = man tests

DISTFILES = COPYRIGHT INSTALL README Makefile.in configure configure.in \
	    patchlevel.h $(SRCS) svipc.h svipcAInit.sed

APP_INIT = tclAppInit.c tkAppInit.c 

all: libsvipc.a
	@echo all done.

libsvipc.a: $(OBJS)
	$(RANLIB) $@

tclAppInit.c: svipcAInit.sed $(TCL_DIR)/tclAppInit.c
	sed -f svipcAInit.sed $(TCL_DIR)/tclAppInit.c > $@

tkAppInit.c: svipcAInit.sed $(TK_DIR)/tkAppInit.c
	sed -f svipcAInit.sed $(TK_DIR)/tkAppInit.c > $@

tclXAppInit.c: svipcAInit.sed $(TCLX_DIR)/src/tclXAppInit.c
	sed -f svipcAInit.sed $(TCLX_DIR)/src/tclXAppInit.c > $@

tclXAppInit.o: tclXAppInit.c
	$(CC) $(CPPFLAGS) -I$(TCLXINC_DIR) $(CCFLAGS) $(DEFS) -c tclXAppInit.c

tkXAppInit.c: svipcAInit.sed $(TKX_DIR)/src/tkXAppInit.c
	sed -f svipcAInit.sed $(TKX_DIR)/src/tkXAppInit.c > $@

tkXAppInit.o: tkXAppInit.c
	$(CC) $(CPPFLAGS) -I$(TCLXINC_DIR) -I$(TKXINC_DIR) $(CCFLAGS) $(DEFS) -c tkXAppInit.c

# Tcl shell with SysV IPC modifications.

tclsh: tclAppInit.o libsvipc.a
	$(CC) $(LDFLAGS) -o tclsh tclAppInit.o $(LDLIBS) libsvipc.a $(TCLLIB) -lm

# Extended Tcl with SysV IPC modifications.

tcl: tclXAppInit.o libsvipc.a
	$(CC) $(LDFLAGS) -o tcl tclXAppInit.o $(LDLIBS) libsvipc.a $(TCLXLIB) $(TCLLIB) -lm

# Standard wish with SysV IPC modifications.

wish: tkAppInit.o libsvipc.a
	$(CC) $(LDFLAGS) -o wish tkAppInit.o $(LDLIBS) libsvipc.a $(TKLIB) $(TCLLIB) $(XLIBS) $(LIBS) -lm

# Extended wish with SysV IPC modifications.

wishx: tkXAppInit.o libsvipc.a
	$(CC) $(LDFLAGS) -o wishx tkXAppInit.o $(LDLIBS) libsvipc.a $(TKXLIB) $(TCLXLIB) $(TKLIB) $(TCLLIB) $(XLIBS) $(LIBS) -lm

install:  install-lib install-man

install-bin: $(PROGS)
	@for prog in $(PROGS); \
	do echo Installing $(bindir)/$(bin_prefix)$$prog; \
	   $(INSTALL_PROG) $$prog $(bindir)/$(bin_prefix)$$prog; \
	done

install-lib: libsvipc.a $(APP_INIT) $(srcdir)/svipc.h
	@echo Installing $(libdir)/$(lib_prefix)libsvipc.a
	@$(INSTALL_DATA) libsvipc.a $(libdir)/$(lib_prefix)libsvipc.a
	@$(RANLIB) $(libdir)/$(lib_prefix)libsvipc.a
	@echo Installing $(incdir)/svipc.h
	@$(INSTALL_DATA) $(srcdir)/svipc.h $(incdir)

install-man: $(MANFILES)
	@cd $(srcdir)/man;for i in *.3; \
	do echo Installing $(man3dir)/$(man_prefix)$$i; \
	   $(INSTALL_DATA) $$i $(man3dir)/$(man_prefix)$$i; \
	done
	@cd $(srcdir)/man;for i in *.n; \
	do echo Installing $(manndir)/$(man_prefix)$$i; \
	   $(INSTALL_DATA) $$i $(manndir)/$(man_prefix)$$i; \
	done

clean:
	rm -f libsvipc.a tclsh tcl wish wishx *.o core

mostlyclean: clean

distclean: clean
	rm -f Makefile config.status tclAppInit.c tkAppInit.c tclXAppInit.c tkXAppInit.c

realclean: distclean
	rm -f TAGS

dist:
	echo svipc-`grep SVIPC_VERSION svipc.h | sed -e 's/.*"\([0-9.]*\)".*/\1/'`.`grep PATCHLEVEL patchlevel.h | cut -d' ' -f3` > .version
	rm -rf `cat .version`
	mkdir `cat .version`
	ln $(DISTFILES) `cat .version`
	cd `cat .version`; mkdir $(DISTDIRS)
	ln $(MANFILES) `cat .version`/man
	ln $(TESTFILES) `cat .version`/tests
	tar chzf `cat .version`.tar.gz `cat .version`
	rm -rf `cat .version` .version

libsvipc.a(svipcInit.o): $(TCL_DIR)/tcl.h
libsvipc.a(svipcInit.o): $(srcdir)/patchlevel.h
libsvipc.a(svipcLink.o): $(TCL_DIR)/tcl.h $(srcdir)/svipc.h
libsvipc.a(svipcMsg.o): $(TCL_DIR)/tcl.h
libsvipc.a(svipcSem.o): $(TCL_DIR)/tcl.h
libsvipc.a(svipcShm.o): $(TCL_DIR)/tcl.h $(srcdir)/svipc.h

#
# $Log: Makefile.in,v $
# Revision 1.6  2003/11/12 19:57:09  abbottd
#  Remove -DSHRIKE
#
# Revision 1.5  2003/11/01 00:17:46  gurjyan
# *** empty log message ***
#
# Revision 1.4  1998/11/06 15:24:43  timmer
# Linux port
#
# Revision 1.3  1998/01/21 20:02:06  heyes
# fix for linux the semun bug
#
# Revision 1.2  1997/05/09 19:40:16  heyes
# 2.0b2
#
# Revision 1.1.1.1  1996/08/21 19:30:08  heyes
# Imported sources
#
# Revision 1.20  1993/11/29  22:08:17  kelsey
# Updated program versions to tcl7.3, tk3.6, and tclX7.3a.
#
# Revision 1.19  1993/11/22  23:52:39  kelsey
# Add LDLIBS to link lines.  You can use this to specify the installed
# locations of the various libraries.  Set LDLIBS=/sea/ntu/tools/lib and
# TCLLIB=-ltcl TKLIB=-ltk TCLXLIB=-ltclx TKXLIB=-ltkx to use libraries
# installed in /sea/ntu/tools/lib/libxxx.a.
#
# Revision 1.18  1993/11/19  22:35:39  kelsey
# Modify installation procedure to copy the AppInit files to
# $(libdir)/svipc.  Also copy svipc.h to $(incdir).  Add support for
# compilation in directory other than $(srcdir).
#
# Revision 1.17  1993/11/19  17:36:07  kelsey
# Update version numbers to Tcl 7.2, Tk 3.5, and TclX7.2a.
#
# Revision 1.16  1993/11/12  22:27:14  kelsey
# Remove SVIPC_BETA_VERSION as using SVIPC_PATCHLEVEL in naming
# distributions serves essentially the same purpose.
#
# Revision 1.15  1993/11/12  22:25:49  kelsey
# Change TCLX_VERSION to 7.1a (remove -B5.)
#
# Revision 1.14  1993/11/12  22:14:13  kelsey
# Include patch level when naming distributions.
#
# Revision 1.13  1993/11/12  21:20:09  kelsey
# Add TclX7.1a compatibility.
# Move Log to end of file.
#
# Revision 1.12  1993/11/08  17:11:21  kelsey
# Fix problem generating tkAppInit from tclAppInit.
#
# Revision 1.11  1993/11/04  23:54:55  kelsey
# Update to tcl7.1, tk3.4.
# Separate install into -bin, -lib, and -man targets.
#
# Revision 1.10  1993/10/14  21:50:56  kelsey
# Fix MANFILES to list correct man pages.
# Add COPYRIGHT and INSTALL to distfiles.
#
# Revision 1.9  1993/10/14  21:28:28  kelsey
# Define CFLAGS based on whether this make uses the variable CPPFLAGS
# in standard compilation scripts.  Modify tclXmain and tkXmain
# commands to conform.
#
# Revision 1.8  1993/10/01  23:29:24  kelsey
# Fix dist sed script error.
#
# Revision 1.7  1993/10/01  23:01:18  kelsey
# Update for TclX7.0a-B4.
# Change dist target to use different method of collecting files and naming
# the release.
#
# Revision 1.6  1993/08/18  21:43:20  kelsey
# Add main.c and tkMain.c to distclean target.
#
# Revision 1.5  1993/08/18  21:34:41  kelsey
# Update to support autoconf.
# Add changes for Tcl 7.0.
# Rename all files with svipc prefix.
#
# Revision 1.4  1993/04/09  01:29:42  kelsey
# Add main*.c to clean.
#
# Revision 1.3  1993/04/08  21:33:34  kelsey
# Modify comments and copyright.
#
# Revision 1.2  1993/04/02  22:19:56  kelsey
# Change copyright notice.
# Use sed scripts for main functions.
#
# Revision 1.1  1992/06/02  14:09:34  kelsey
# Initial revision
#
