# Generated automatically from Makefile.in by configure.
##########################################################################
##                 GNU SQL Server  (server administrator daemon)        ##
##                                                                      ##
##			Administrator of                                ##
##  Storage and Transaction Synchrohization Management System           ##
##		    ( engine of SQL-server);                            ##
##	   child prosesses: buf, mj, lj, srt, syn, trn                  ##
##                                                                      ##
##########################################################################
##
## $Id: Makefile.src.engine.in,v 1.245 1997/03/31 03:46:38 kml Exp $
##
## This file is a part of GNU SQL Server
##
## Copyright (c) 1996, 1997, Free Software Foundation, Inc
## Developed at Institute of System Programming of Russian Academy of Science
## This file is written by Michael Kimelman
##
## This program is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 of the License, or (at your option)
## any later version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
## more details.
##
## You should have received a copy of the GNU General Public License along with
## this program; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## Contacts: gss@ispras.ru
##

srcdir=/var/tmp/gnusql-0.7b5/src/engine
VPATH=/var/tmp/gnusql-0.7b5/src/engine
include ../Makefile_h
##########################################################################
#                make program                                            #
##########################################################################
SUBDIR=    trans buf jour sort synch rcvutl

all:    install
createdirs: 
	- [ -d $(SERVDIR) ] || mkdir -p $(SERVDIR)
	- [ -d $(SERVDIR)/db ] || mkdir -p $(SERVDIR)/db
	- [ -d $(SERVBIN) ] || mkdir -p $(SERVBIN)
	- [ -d $(CLNT) ] || mkdir -p $(CLNT)
	- [ ! -f $(SERVDIR)/adm ] || rm -f $(SERVDIR)/adm
	- [ ! -f $(SERVBIN)/prepup ] || rm -f $(SERVBIN)/prepup
	- [ ! -f $(SERVBIN)/chpars ] || rm -f $(SERVBIN)/chpars

install upgrade: createdirs bin
	$(CP)  adm $(SERVDIR)/gsqls
	$(CP)  prepup $(SERVBIN)
	$(CP)  chpars $(SERVBIN)

boot: instclean upgrade
	( cd $(SERVDIR) ; bin/prepup )

instclean:
	- [ -d $(SERVDIR) ] && ( cd $(SERVDIR); rm -r -f * )

bin:    announce client server
client: $(LIBCLI) 
server: subdirs $(LIBSR_DEP) adm prepup chpars
libgss_cli : dispatch_clnt.$(O) dispatch_xdr.$(O)
	echo $? >$@
libgss_ser : dispatch_xdr.$(O)
	echo $? >$@

subdirs: headers
	for dir in $(SUBDIR); do \
	( cd $$dir; $(MAKE) ; );  done

adm:  adm.$(O) dispatch.$(O) dispatch_svc.$(O) $(LIBSR_DEP)
	echo --  generating $@
	- $(RM) $@ 
	$(LD) adm.$(O) dispatch.$(O) dispatch_svc.$(O)  $(SRLIBS) -o $@ 

adm.$(O): adm.c $(LIINC)/dispatch.h $(IINC)/pupsi.h $(INC)/global.h \
    $(IINC)/inpop.h $(IINC)/expop.h   $(IINC)/totdecl.h\
    $(IINC)/strml.h $(IINC)/adfstr.h  $(IINC)/rnmtp.h \
    admdef.h rcvutl/puprcv.h 
dispatch.$(O):      dispatch.c      $(LIINC)/dispatch.h admdef.h $(IINC)/totdecl.h
dispatch_svc.$(O):  dispatch_svc.c  $(LIINC)/dispatch.h 
dispatch_clnt.$(O): dispatch_clnt.c $(LIINC)/dispatch.h 
dispatch_xdr.$(O):  dispatch_xdr.c  $(LIINC)/dispatch.h 

dispatch_svc.c dispatch_clnt.c $(LIINC)/dispatch.h dispatch_xdr.c : dispatch.x
	$(RPCGEN) $(LIINC) $(srcdir)/dispatch.x
prepup:  prepup.$(O) rcvutl/libini.$(O) $(LIBSR_DEP)
	echo --  generating $@
	- $(RM) $@ 
	$(LD) prepup.$(O) rcvutl/libini.$(O) $(SRLIBS) -o $@ 

prepup.$(O): prepup.c $(IINC)/pupsi.h $(IINC)/destrn.h admdef.h \
    $(IINC)/strml.h $(IINC)/adfstr.h $(IINC)/rnmtp.h trans/gltran.h $(IINC)/totdecl.h 
    
chpars:  chpars.$(O) 
	echo --  generating $@
	- $(RM) $@ 
	$(LD) chpars.$(O) $(CLLIBS) -o $@ 

chpars.$(O): chpars.c $(LIINC)/dispatch.h dyngspar.h gspstr.h

clean::
	- $(RM) adm prepup chpars
	- $(RM) dispatch_svc.c dispatch_clnt.c dispatch.h dispatch_xdr.c

headers : admdef.h $(LIINC)/dispatch.h dyngspar.h gspstr.h 
	( cd rcvutl ; $(MAKERT) headers)
	( cd synch  ; $(MAKERT) headers)
