# Generated automatically from Makefile.in by configure.
##############################################################
##                 GNU SQL Server                           ##
##############################################################
## $Id: Makefile.in,v 1.249 1997/04/15 19:27:41 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
##

SHELL=/bin/sh

# If Make doesn't predefine MAKE, set it here.
MAKE=/usr/local/bin/make

CC=gcc
INSTALL=/usr/local/bin/install -c
LN_S=ln -s
RM=rm -f 

# formal install directories (by 'ln -s')
prefix=/usr/pkg/gnusql-0.7b5
host=i386-pc-solaris2.5.1
version=0.7b5

bindir=$(prefix)/bin
mandir=$(prefix)/man
infodir=$(prefix)/info

#working directories
dbhome=$(prefix)/share/gnusql/$(version)/$(host)

#build settings
srcdir=/var/tmp/gnusql-0.7b5
VPATH=/var/tmp/gnusql-0.7b5
builddir=/var/tmp/gnusql-0.7b5

SERVDIR=$(builddir)/sqlser
SERVBIN=$(SERVDIR)/bin
CLNT=$(SERVDIR)/client
TOUCH=/var/tmp/gnusql-0.7b5/etc/Touch

MAKECLEAN=$(MAKE) -k REV=$(REV) clean
MAKERT=$(MAKE) -k REV=$(REV)

all     : confs
	$(MAKERT) compile
client : confs
	$(MAKERT) client.stamp
server  : confs
	$(MAKERT) server.stamp
compile : prepdirs.stamp
	( cd etc ; $(MAKERT) )
	( cd src ; $(MAKERT) )
server.stamp : prepdirs.stamp
	( cd etc ; $(MAKERT) )
	( cd src ; $(MAKERT) server )
client.stamp  : prepdirs.stamp
	( cd src ; $(MAKERT) client )
install-c : client.stamp
install-s : server.stamp
install : install-c install-s
	@echo 'BE CAREFUL: THIS IS THE FIRST BETA TEST. AND IT HAS BUGS!!!!'
	@echo 'type control-C now if you are not sure'
	sleep 10
	@echo 'Installation started .....'
#    put docs in server dirs
	( cd etc; $(MAKERT) install );   
#    put headers in server dirs
	( cd $(srcdir)/src/include ; \
           for f in sql.h dyn_funcs.h sql_type.def errors.h ; do \
             test -f $(CLNT)/$$f && rm $(CLNT)/$$f ;             \
             $(INSTALL) -m 644 $$f $(CLNT)/$$f     ;             \
           done                                                  \
        )
#    check existence of desctination directories
	- test -d $(dbhome)         || mkdir -p $(dbhome)
	- test -d $(bindir)         || mkdir -p $(bindir)
	- test -d $(prefix)/lib     || mkdir -p $(prefix)/lib
	- test -d $(prefix)/include || mkdir -p $(prefix)/include
	- test -d $(mandir)/man1    || mkdir -p $(mandir)/man1
	- test -d $(infodir)        || mkdir -p $(infodir)
#    go to server and init it.
	( cd $(SERVDIR); $(srcdir)/etc/boot >/dev/null ; bin/finadm </dev/null ; )
#    install whole working system in appropriate directory
	cp -r  $(SERVDIR)/* $(dbhome)
#    change place to store backup 
#	echo what should I change here?? to point new backup place
#    put link to clients tools (compiler, runtime, mans, infos etc) 
#    into commonly used places
	$(srcdir)/etc/make-util install "$(LN_S)" "$(dbhome)" "$(bindir)" \
                                        "$(mandir)" "$(infodir)" "$(prefix)" 
localclean:
	- $(RM) *.cache *.log *.status
clean: 
	- $(RM) src/include/config.h 
	- $(RM) -r -f sqlser lib
	$(srcdir)/etc/conf-templ clean
	$(srcdir)/etc/make-util clean "$(MAKECLEAN)"
	- $(RM) -f etc/RCS test/RCS test/Makefile
	- $(RM) *.cache *.log *.status *.stamp
	- $(RM) Makefile
prepdirs.stamp:
	- [ -d $(SERVDIR) ]    || mkdir -p $(SERVDIR)
	- [ -d $(SERVDIR)/db ] || mkdir -p $(SERVDIR)/db
	- [ -d $(SERVBIN) ]    || mkdir -p $(SERVBIN)
	- [ -d $(CLNT) ]       || mkdir -p $(CLNT)
	- [ -d lib ]           || mkdir -p lib
	echo "Ok">$@

test:
	( cd test ;  $(MAKE); )

confs: src/Makefile src/include/config.h make-dist

${srcdir}/configure: configure.in             aclocal.m4
	[ ! -f config.cache ] || $(RM) config.cache
	cd ${srcdir} && autoconf
# autoheader might not change config.h.in, so touch a stamp file.
${srcdir}/config.h.in: stamp-h.in
${srcdir}/stamp-h.in: configure.in acconfig.h aclocal.m4 
	cd ${srcdir} && autoheader
	echo timestamp > ${srcdir}/stamp-h.in

src/include/config.h: stamp-h 
src/Makefile        : stamp-h 
stamp-h: config.h.in src/Makefile.in config.status
	./config.status

config.status: ${srcdir}/configure
	./config.status --recheck

## commnet cycle dependencies ##config.h.in: ${srcdir}/config.h.in  ## stupid dependencies, but they need
## commnet cycle dependencies ##stamp-h.in : ${srcdir}/stamp-h.in   ## these files condidered different by make

force:


#.SILENT:
