#*********************************************************************
#
# File:          Makefile
#
# Project:       Device Servers with sun-rpc
#
# Description:   Makefile for API-LIB, the Application Programmer's 
#                Interface Library - libdsapi (archive) and libdsapi.so 
#		 (shared).
#
#                Please use the conditional GNU Makefile commands !
#
# Author(s):     Jens Meyer, Andy Gotz
#
# Original:	 January 1992
#
#
# $Revision: 4.55 $
# $Date: 1999/05/23 13:01:27 $
#
# $Author: goetz $
#
# Copyright (c) 1990 by European Synchrotron Radiation Facility,
#                       Grenoble, France
#
#                       All Rights Reserved
#
#**********************************************************************

#---------------------------------------------------------------------
# Home Directories
#
#
#       The variables DSHOME is passed to the Makefile
#       as input arguments or via the environment.
#
# external variable DSHOME
DS_HOME   =   	$(DSHOME)

APIVERS=$(shell ident dev_api.c | grep Header | awk -f ./version.awk)

ifndef vwx86
DEV_CLASS =     ../../../../classes/main
DEV_CLASSP =    ../../../../classes++/device
DEV_CMDS  =     ../../cmds_err
else
DEV_CLASS =     ..\..\..\..\classes\main
DEV_CLASSP =    ..\..\..\..\classes++\device
DEV_CMDS  =     ..\..\cmds_err
endif # !vwx86
LOHOME    =	`pwd`

ifdef vwx86
RM = del
else
RM = rm -rf
endif # vwx86

ifdef _UCC
INSTALL_HOME =  $(DS_HOME)/lib/os9
endif
ifdef __hp9000s700
INSTALL_HOME =  $(DS_HOME)/lib/s700
INSTALL_HOME_SL =  $(DS_HOME)/lib/s700
endif
ifdef __hpux10
INSTALL_HOME =  $(DS_HOME)/lib/hpux10.2
INSTALL_HOME_SL =  $(DS_HOME)/lib/hpux10.2
endif
ifdef sun
INSTALL_HOME =  $(DS_HOME)/lib/sun4
endif
ifdef _solaris
INSTALL_HOME =  $(DS_HOME)/lib/solaris
INSTALL_HOME_SL =  $(DS_HOME)/lib/solaris
endif
ifdef lynx
INSTALL_HOME =  $(DS_HOME)/lib/lynxos
endif
ifdef linux
ifdef x86
INSTALL_HOME =  $(DS_HOME)/lib/linux/x86
INSTALL_HOME_SL =  $(DS_HOME)/lib/linux/x86
endif # x86
ifdef 68k
INSTALL_HOME =  $(DS_HOME)/lib/linux/68k
INSTALL_HOME_SL =  $(DS_HOME)/lib/linux/68k
endif # 68k
endif # linux
ifdef vw68k
INSTALL_HOME =  $(DS_HOME)/lib/vxworks/68k
endif
ifdef vwx86
INSTALL_HOME =  $(DS_HOME)\lib\vxworks\x86
endif



#---------------------------------------------------------------------
ifdef _UCC
#               The C Compiler for OS9
#CC =            /usr/local/MWOS/UNIX/bin/hp97k/xcc

#               ... and his Flags
#                       Includes
INCLDIRS=       -I ../include \
                -I ../../cmds_err/include \
                -I ../../../../classes/main/include \
                -I ../../../xdr/include \
		-I ../../admin/include \
                -I $(DS_HOME)/include \
                -I $(DS_HOME)/include/private \
                -I /usr/local/os9/dd/DEFS

#                       Compiler Flags
CFLAGS =        -mode=c89 -g -D EBUG -to osk -tp 020 -x il -e as=. \
		$(INCLDIRS) $(EXTRACFLAGS)
ICODE_CFLAGS =  -mode=c89 -to osk -tp 020 -e il $(INCLDIRS)
#ICODE_CFLAGS =  -mode=c89 -D EBUG -to osk -tp 020 -e il $(INCLDIRS)
NAME =          -o $@
endif

ifdef unix
#               ... and his Flags
#                       Includes
CINCLDIRS=      -I../include \
		-I../../cmds_err/include \
		-I../../../../classes/main/include \
		-I../../../xdr/include \
		-I../../admin/include \
		-I$(DS_HOME)/include \
		-I$(DS_HOME)/include/private

ifndef vwx86
INCLDIRS=	$(CINCLDIRS)
endif
ifdef vw68k
INCLDIRS=	-I/usr/local/tornado/target/h \
		-I/usr/local/tornado/target/h/rpc \
		-I/usr/local/tornado/target/src/config \
		$(CINCLDIRS)
endif # vw68k
ifdef vwx86
INCLDIRS=	$(CINCLDIRS) \
		-IC:\TORNADO\target\h \
		-IC:\TORNADO\target\h\rpc \
		-IC:\TORNADO\target\src\config
endif # vwx86

#                       Libraries
#               No link phase - ergo no libraries to include

NAME    =       -o
endif # unix

#                       Optimizer or ANSI standart?
ifdef __hpux
CFLAGS  =       -Aa -g -DEBUG -Dunix -D_HPUX_SOURCE -c $(INCLDIRS) \
		$(EXTRACFLAGS)
CFLAGS_SL  =    $(CFLAGS) +z
endif
ifdef __hpux10
CFLAGS  =       -Aa -g -DEBUG -Dunix -D_HPUX_SOURCE -D__hpux10 \
		-DBSD=199704 -c $(INCLDIRS) $(EXTRACFLAGS)
CFLAGS_SL  =    $(CFLAGS) +z
endif
ifdef sun
CFLAGS  =       -Aa -g -DEBUG -Dunix -c $(INCLDIRS) $(EXTRACFLAGS)
endif
ifdef _solaris
ifdef NATIF
CFLAGS  =       -Xa -g -Dsolaris -DEBUG -c $(INCLDIRS) $(EXTRACFLAGS)
CFLAGS_SL  =    $(CFLAGS) -KPIC
else
CFLAGS  =       -g -Dsolaris -DEBUG -c $(INCLDIRS) $(EXTRACFLAGS)
CFLAGS_SL  =    $(CFLAGS) -fPIC
endif # NATIF
endif
ifdef lynx
CFLAGS  =      	-Dlynx -Dunix -ansi -X -DEBUG -g -c $(INCLDIRS) $(EXTRACFLAGS)
endif
ifdef linux
ifdef x86
CFLAGS  =      	$(INCLDIRS) -Dlinux -Dunix -D_GNU_SOURCE -D_POSIX_SOURCE \
		-ansi -DEBUG -g -c  $(EXTRACFLAGS)
CFLAGS_SL  =   	$(INCLDIRS) -Dlinux -Dunix -D_GNU_SOURCE -D_POSIX_SOURCE \
		-ansi -DEBUG -fPIC -c
else
CFLAGS  =       $(INCLDIRS) -Dlinux -Dunix -Dlinux68k -D_POSIX_SOURCE \
		-D_GNU_SOURCE -ansi -DEBUG -I/usr/include/m68k-linux -g -c \
		$(EXTRACFLAGS)
CFLAGS_SL  =    $(INCLDIRS) -Dlinux -Dunix -Dlinux68k -D_POSIX_SOURCE \
		-D_GNU_SOURCE -ansi -DEBUG -I/usr/include/m68k-linux -fPIC -c \
		$(EXTRACFLAGS)
endif # x86
endif # linux
ifdef vw68k
CFLAGS	=	-Dvxworks -Dunix -DCPU=MC68040 -ansi -m68040 \
		-fno-builtin -nostdinc -DEBUG $(INCLDIRS) \
		$(EXTRACFLAGS)
endif 
ifdef vwx86
CFLAGS	=	-c -Dvxworks -Dunix -D__STDC__ -fno-builtin  -nostdinc \
		-fno-defer-pop -mno-486 -DCPU=I80386 -ansi \
		-DEBUG $(INCLDIRS) -g $(EXTRACFLAGS)
endif

#---------------------------------------------------------------------
# RCS options
#
#               RCS lock options
RCSLOCK  =      co -l -r$(VERSION)
#               RCS check out options
RCSCO    =      co -r$(VERSION)
#               RCS check in options
RCSCI    =      ci -u -f -s"Rel" -r$(VERSION) -m"$(LOCKMSG)"
#               RCS unlock options
RCSUNLOCK  =    rcs -u$(VERSION)
#               RCS diff options
RCSDIFF    =    rcsdiff -r$(VERSION)

#---------------------------------------------------------------------
# All files needed for the library
#
#	File list for RCS control
#               all include files
API_INCL   =   	API.h \
		ApiP.h \
		DevSec.h
CLASS_INCL =	DevServerP.h \
		DevServer.h \
		DevSignal.h
CLASSP_INCL =	Device.H

#               source files
API_SRC   = 	gen_api.c \
	 	dev_api.c \
	 	util_api.c \
		sec_api.c \
		asyn_api.c \
		event_api.c
CLASS_SRC =	gettrans.c \
		svc_api.c \
		oic.c \
		ds_prog_vers3.c \
		DevServer.c \
		DevServerMain.c \
		startup.c \
		DevServerSig.c
CLASSP_SRC = 	Device.C

#
#	source list to make library
#		source files
ifdef vwx86
SRC =		gen_api.c \
	 	dev_api.c \
	 	util_api.c \
		sec_api.c \
		asyn_api.c \
		event_api.c \
		dev_errors.c \
		dev_states.c \
		gettrans.c \
		svc_api.c \
		oic.c \
		ds_prog_vers3.c \
		DevServer.c \
		DevServerMain.c \
		startup.c \
		DevServerSig.c
else
SRC =		gen_api.c \
	 	dev_api.c \
	 	util_api.c \
		sec_api.c \
		asyn_api.c \
		event_api.c \
		dev_errors.c \
		dev_states.c \
		$(DEV_CLASS)/src/gettrans.c \
		$(DEV_CLASS)/src/svc_api.c \
		$(DEV_CLASS)/src/oic.c \
		$(DEV_CLASS)/src/ds_prog_vers3.c \
		$(DEV_CLASS)/src/DevServer.c \
		$(DEV_CLASS)/src/DevServerMain.c \
		$(DEV_CLASS)/src/startup.c \
		$(DEV_CLASS)/src/DevServerSig.c
endif # vwx86

#               object files
ifdef vwx86
OBJS =		gen_api.o \
  		dev_api.o \
	 	util_api.o \
		sec_api.o \
		asyn_api.o \
		event_api.o \
		dev_errors.o \
		dev_states.o \
  		gettrans.o \
		svc_api.o \
		oic.o \
		ds_prog_vers3.o \
  		DevServer.o \
  		DevServerMain.o \
		startup.o \
  		DevServerSig.o

else
OBJS =		gen_api.o \
  		dev_api.o \
	 	util_api.o \
		sec_api.o \
		asyn_api.o \
		event_api.o \
		dev_errors.o \
		dev_states.o \
  		$(DEV_CLASS)/src/gettrans.o \
		$(DEV_CLASS)/src/svc_api.o \
		$(DEV_CLASS)/src/oic.o \
		$(DEV_CLASS)/src/ds_prog_vers3.o \
  		$(DEV_CLASS)/src/DevServer.o \
  		$(DEV_CLASS)/src/DevServerMain.o \
		$(DEV_CLASS)/src/startup.o \
  		$(DEV_CLASS)/src/DevServerSig.o

OBJSNOMAIN =	gen_api.o \
  		dev_api.o \
	 	util_api.o \
		sec_api.o \
		asyn_api.o \
		event_api.o \
		dev_errors.o \
		dev_states.o \
  		DevServerNoMain.o \
  		$(DEV_CLASS)/src/gettrans.o \
		$(DEV_CLASS)/src/svc_api.o \
		$(DEV_CLASS)/src/oic.o \
		$(DEV_CLASS)/src/ds_prog_vers3.o \
  		$(DEV_CLASS)/src/DevServer.o \
		$(DEV_CLASS)/src/startup.o \
  		$(DEV_CLASS)/src/DevServerSig.o
endif # vwx86


OBJS_SL =	gen_api.sl.o \
  		dev_api.sl.o \
	 	util_api.sl.o \
		sec_api.sl.o \
  		asyn_api.sl.o \
  		event_api.sl.o \
		dev_errors.sl.o \
		dev_states.sl.o \
  		$(DEV_CLASS)/src/gettrans.sl.o \
		$(DEV_CLASS)/src/svc_api.sl.o \
		$(DEV_CLASS)/src/oic.sl.o \
		$(DEV_CLASS)/src/ds_prog_vers3.sl.o \
  		$(DEV_CLASS)/src/DevServer.sl.o \
 		$(DEV_CLASS)/src/DevServerMain.sl.o \
		$(DEV_CLASS)/src/startup.sl.o \
  		$(DEV_CLASS)/src/DevServerSig.sl.o


ICODE_OBJS = 	gen_api.ic \
  		dev_api.ic \
	 	util_api.ic \
		sec_api.ic \
  		asyn_api.ic \
  		event_api.ic \
		dev_errors.ic \
		dev_states.ic \
		$(DEV_CLASS)/src/gettrans.ic \
		$(DEV_CLASS)/src/svc_api.ic \
		$(DEV_CLASS)/src/oic.ic \
		$(DEV_CLASS)/src/ds_prog_vers3.ic \
		$(DEV_CLASS)/src/DevServer.ic \
		$(DEV_CLASS)/src/DevServerMain.ic \
		$(DEV_CLASS)/src/startup.ic \
		$(DEV_CLASS)/src/DevServerSig.ic

ifdef OSK
OBJS = 		gen_api.r \
 		dev_api.r \
	 	util_api.r \
		sec_api.r \
 		asyn_api.r \
 		event_api.r \
		dev_errors.r \
		dev_states.r \
  		gettrans.r \
		svc_api.r \
		oic.r \
		ds_prog_vers3.r \
  		DevServer.r \
		DevServerMain.r \
		startup.r \
		DevServerSig.r
endif

#--------------------------------------------------------------------
# What has to be made
#
ifndef vxworks
LIBNAME =       libdsapi.a
LIBNOMAINNAME = libdsapinomain.a
else # !vxworks 
LIBNAME =       libdsapi.a
#LIBNAME =       libdsapi.o
LIBNOMAINNAME = libdsapinomain.o
endif # !vxworks

ifdef _solaris
LIBNAME_SL =    libdsapi
SL_EXT     =    so
endif
ifdef __hp9000s700
LIBNAME_SL =    libdsapi
SL_EXT     =    sl
endif
ifdef linux
LIBNAME_SL =    libdsapi
SL_EXT     =    so
endif

ifdef _UCC
ICODE_LIBNAME = libdsapi.il
endif

#               Names of the include files in the 
#		installation directories
#
INCL_INST  = 	../include/API.h \
		../include/DevSec.h \
		$(DEV_CLASS)/include/DevServer.h \
		$(DEV_CLASS)/include/DevSignal.h \
		$(DEV_CMDS)/include/DevErrors.h \
		$(DEV_CMDS)/include/DevCmds.h \
		$(DEV_CMDS)/include/DevStates.h
#		$(DEV_CMDS)/include/DserverTeams.h \
#		$(DEV_CMDS)/include/CntrlDsNumbers.h
INCLP_INST = 	../include/ApiP.h \
		$(DEV_CLASS)/include/DevServerP.h

#---------------------------------------------------------------------
# Build library

ifdef unix
ifndef vxworks
all:	$(OBJS) $(LIBNAME) $(LIBNOMAINNAME)
else
all:	$(OBJS) $(LIBNAME) 
endif # !vxworks
else
all:	$(OBJS) $(LIBNAME) 
endif # unix

all_sl:	$(LIBNAME_SL).$(SL_EXT)

#
# DO NOT force recompilation of all source files
#
# EXCEPT for VxWorks x86 platform !
#ifdef vxworks
#$(OBJS): $(SRC)
#		$(CC) $(CFLAGS) $(SRC)
#endif # vxworks

ifdef unix
ifndef vwx86 
DevServerNoMain.o : $(DEV_CLASS)/src/DevServerMain.c
	$(CC) $(CFLAGS) -DNOMAIN $(DEV_CLASS)/src/DevServerMain.c
	mv DevServerMain.o DevServerNoMain.o
endif # vwx86
endif # unix
	

ifdef OSK
#               Making an OS-9 library is concatenating the members
$(LIBNAME):     $(OBJS)
		$(RM) $(LIBNAME)
		cat $(OBJS) > $(LIBNAME)      

$(LIBNOMAINNAME):     $(OBJSNOMAIN)
		$(RM) $(LIBNOMAINNAME)
		cat $(OBJSNOMAIN) > $(LIBNOMAINNAME)      
endif

ifdef unix
# define a rule for making shared library objects (suffice .sl.o)
.SUFFIXES: .sl.o .c
.c.sl.o:
		$(CC) $(CFLAGS_SL) $< -o $*.sl.o
endif

ifdef _UCC
.SUFFIXES: .ic .c
.c.ic:
	        $(CC) $(ICODE_CFLAGS) $(NAME) -efe $<
.SUFFIXES: .ic .C
.C.ic:

#
# DO NOT recompile all icode files - andy 18nov96
#
#$(ICODE_OBJS):	
#	        $(CC) $(ICODE_CFLAGS) $(NAME) -efe $<


$(LIBNAME):     $(OBJS) $(ICODE_OBJS)
		libgen $(OBJS) -co=$(LIBNAME)
		$(CC) $(ICODE_CFLAGS) $(ICODE_OBJS) -Wi,-m -f $(ICODE_LIBNAME)

$(LIBNOMAINNAME): $(OBJSNOMAIN) 
		libgen $(OBJSNOMAIN) -co=$(LIBNOMAINNAME)
endif


ifdef unix
#		Make HPUX library
$(LIBNAME):     $(OBJS)
ifdef vw68k
		ar68k -rc $(LIBNAME) $(OBJS) 
		ar68k -s $(LIBNAME) $(OBJS) 
#		ranlib68k $(LIBNAME)
else
ifdef vwx86
		ar386 -rc $(LIBNAME) $(OBJS) 
		ar386 -s $(LIBNAME) $(OBJS) 
#		ld386 -r -o $(LIBNAME) $(OBJS)
else
ifdef 68k
		m68k-linux-ar -r  $(LIBNAME) $(OBJS)
		m68k-linux-ranlib  $(LIBNAME)
else
		ar rv $(LIBNAME) $(OBJS)
endif # 68k
endif # vwx86
endif # vw68k

ifndef vxworks
$(LIBNOMAINNAME):     $(OBJSNOMAIN)
		ar rv $(LIBNOMAINNAME) $(OBJSNOMAIN)
endif # !vxworks

$(LIBNAME_SL).$(SL_EXT):	$(OBJS_SL)
ifdef APIVERS
		echo "making shared library VERSION $(APIVERS) ..."
ifdef _solaris
		ld -G -o $(LIBNAME_SL).$(APIVERS).$(SL_EXT) $(OBJS_SL)
endif # _solaris
ifdef __hp9000s700
		ld -b -o $(LIBNAME_SL).$(APIVERS).$(SL_EXT) $(OBJS_SL)
endif # __hp9000s700
ifdef linux
		$(CC) -shared -Wl,-soname,$(LIBNAME_SL).$(SL_EXT) \
		-o $(LIBNAME_SL).$(APIVERS).$(SL_EXT) $(OBJS_SL)
endif # linux
		$(RM) $(LIBNAME_SL).$(SL_EXT)
		ln -s $(LIBNAME_SL).$(APIVERS).$(SL_EXT) $(LIBNAME_SL).$(SL_EXT)
else
		echo "cannot make shared library, APIVERS not defined !"
endif # APIVERS
endif # unix

install_incl:	
ifdef __hp9000s700
	cp -f ../include/API.h $(DSHOME)/include
	chmod 664 $(DSHOME)/include/API.h
	cp -f ../include/DevSec.h $(DSHOME)/include
	chmod 664 $(DSHOME)/include/DevSec.h
	cp -f $(DEV_CLASS)/include/DevServer.h $(DSHOME)/include
	chmod 664 $(DSHOME)/include/DevServer.h
	cp -f $(DEV_CLASS)/include/DevSignal.h $(DSHOME)/include
	chmod 664 $(DSHOME)/include/DevSignal.h
	cp -f $(DEV_CMDS)/include/DevErrors.h $(DSHOME)/include
	chmod 664 $(DSHOME)/include/DevErrors.h
	cp -f $(DEV_CMDS)/include/DevCmds.h $(DSHOME)/include
	chmod 664 $(DSHOME)/include/DevCmds.h
	cp -f $(DEV_CMDS)/include/DevStates.h $(DSHOME)/include
	chmod 664 $(DSHOME)/include/DevStates.h
#	cp -f $(DEV_CMDS)/include/DserverTeams.h $(DSHOME)/include
#	chmod 664 $(DSHOME)/include/DserverTeams.h
#	cp -f $(DEV_CMDS)/include/CntrlDsNumbers.h $(DSHOME)/include
#	chmod 664 $(DSHOME)/include/CntrlDsNumbers.h
	cp -f ../include/ApiP.h $(DSHOME)/include/private
	chmod 664 $(DSHOME)/include/private/ApiP.h
	cp -f $(DEV_CLASS)/include/DevServerP.h $(DSHOME)/include/private
	chmod 664 $(DSHOME)/include/private/DevServerP.h
endif 
		

install :       install_incl
#		install library
		cp $(LIBNAME) $(INSTALL_HOME)
ifdef unix
ifndef vxworks
		cp $(LIBNOMAINNAME) $(INSTALL_HOME)
endif # !vxworks
endif # unix
ifdef _UCC
		cp $(ICODE_LIBNAME) $(INSTALL_HOME)
endif

install_sl :
ifdef APIVERS
		echo "installing shared library VERSION $(APIVERS) ..."
		cp $(LIBNAME_SL).$(APIVERS).$(SL_EXT) $(INSTALL_HOME_SL)
		$(RM) $(INSTALL_HOME_SL)/$(LIBNAME_SL).$(SL_EXT)
		cd $(INSTALL_HOME_SL); \
		ln -s $(LIBNAME_SL).$(APIVERS).$(SL_EXT) $(LIBNAME_SL).$(SL_EXT)
else
		echo "cannot install shared library, APIVERS not defined !"
endif # APIVERS

clean :
		$(RM) $(OBJS)
ifndef vxworks
		$(RM) $(OBJS_SL)
endif # !vxworks
ifdef _UCC
		rm -rf $(ICODE_OBJS)
endif # _UCC
#		$(RM) *.o
#		$(RM) $(DEV_CLASS)/src/?*.o
#		$(RM) *.i
#		$(RM) $(DEV_CLASS)/src/?*.i


clobber:	clean
		$(RM) $(LIBNAME) 
		$(RM) $(LIBNOMAINNAME) 
ifdef LIBNAME_SL
		$(RM) $(LIBNAME_SL).$(SL_EXT)
		$(RM) $(LIBNAME_SL).$(APIVERS).$(SL_EXT)
endif
ifdef _UCC
		$(RM) $(ICODE_LIBNAME)
		$(RM) $(ICODE_LIBNAME)
endif


lock:
		$(RCSLOCK) $(API_SRC)
		cd ../include; $(RCSLOCK) $(API_INCL)
		cd $(DEV_CLASS)/src; $(RCSLOCK) $(CLASS_SRC)
		cd $(DEV_CLASS)/include; $(RCSLOCK) $(CLASS_INCL)
		cd $(DEV_CLASSP)/src; $(RCSLOCK) $(CLASSP_SRC)
		cd $(DEV_CLASSP)/include; $(RCSLOCK) $(CLASSP_INCL)
		cd $(LOHOME)

co:
		$(RCSCO) $(API_SRC)
		cd ../include; $(RCSCO) $(API_INCL); cd ../src
		cd $(DEV_CLASS)/src; $(RCSCO) $(CLASS_SRC)
		cd $(DEV_CLASS)/include; $(RCSCO) $(CLASS_INCL)
		cd $(DEV_CLASSP)/src; $(RCSCO) $(CLASSP_SRC)
		cd $(DEV_CLASSP)/include; $(RCSCO) $(CLASSP_INCL)
		cd $(LOHOME)

ci:
		$(RCSCI) $(API_SRC)
		cd ../include; $(RCSCI) $(API_INCL); cd ../src
		cd $(DEV_CLASS)/src; $(RCSCI) $(CLASS_SRC)
		cd $(DEV_CLASS)/include; $(RCSCI) $(CLASS_INCL)
		cd $(DEV_CLASSP)/src; $(RCSCI) $(CLASSP_SRC)
		cd $(DEV_CLASSP)/include; $(RCSCI) $(CLASSP_INCL)
		cd $(LOHOME)

unlock:
		$(RCSUNLOCK) $(API_SRC)
		cd ../include; $(RCSUNLOCK) $(API_INCL)
		cd $(DEV_CLASS)/src; $(RCSUNLOCK) $(CLASS_SRC)
		cd $(DEV_CLASS)/include; $(RCSUNLOCK) $(CLASS_INCL)
		cd $(DEV_CLASSP)/src; $(RCSUNLOCK) $(CLASSP_SRC)
		cd $(DEV_CLASSP)/include; $(RCSUNLOCK) $(CLASSP_INCL)
		cd $(LOHOME)

diff:
		$(RCSDIFF) $(API_SRC)
		cd ../include; $(RCSDIFF) $(API_INCL)
		cd $(DEV_CLASS)/src; $(RCSDIFF) $(CLASS_SRC)
		cd $(DEV_CLASS)/include; $(RCSDIFF) $(CLASS_INCL)
		cd $(DEV_CLASSP)/src; $(RCSDIFF) $(CLASSP_SRC)
		cd $(DEV_CLASSP)/include; $(RCSDIFF) $(CLASSP_INCL)
		cd $(LOHOME)

#
# here is the pattern rule on how to generate the dependancies file(s)
# 
# NOT WORKING i.e. comment out
#
#%.d: %.c
#	$(SHELL) -ec '$(CC) -M $(CFLAGS) $< | sed '\''s:$*.o:& $@:g'\'' > $@'
#
# include header file dependancies for the source file
#
#include $(SRC:.c=.d)
