# Generated automatically from Makefile_h.in by configure.
##############################################################
##   GNU SQL Compiler (common rules and substitutions)      ##
##############################################################
##
## $Id: Makefile_h.src.in,v 1.246 1997/04/28 13:21:13 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

#build settings
top_srcdir=/var/tmp/gnusql-0.7b5
#srcdir=/var/tmp/gnusql-0.7b5/src
builddir=/var/tmp/gnusql-0.7b5
src_root=$(top_srcdir)/src
ETC=$(top_srcdir)/etc
LIB=$(builddir)/lib

INC=$(src_root)/include
TRL=$(src_root)/trl
IINC=$(INC)/engine
EINC=$(src_root)/engine

# for generated files
LINC=$(builddir)/src/include
LIINC=$(LINC)/engine

SERVDIR=$(builddir)/sqlser
SERVBIN=$(SERVDIR)/bin
CLNT=$(SERVDIR)/client

CC=gcc
RANLIB=ranlib
RPCGEN=/var/tmp/gnusql-0.7b5/etc/rpcgen-sh /usr/bin/rpcgen "."
INSTALL=/usr/local/bin/install -c
LN_S=ln -s
YACC=bison # bison -- yacc compatibility requires a lot of fixing @n problems
LEX=flex
A2K=: $(ETC)/ansi2knr-sh srcdir=$(srcdir) lib=$(LIB)

RM=rm -f 
CP=cp
CPI=$(ETC)/move-if-change cp
MV=$(ETC)/move-if-change mv
KITTY=$(LIB)/kitty
O=o
C=c
H=h

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

LIBSER=$(LIB)/libgss_ser.a
LIBCLI=$(CLNT)/libgss.a

LIBSR_DEP= $(LIBSER)_stamp
LIBCL_DEP= $(LIBCLI)_stamp
SRLIBS=-lgss_ser -lfl -lintl -lnsl 
CLLIBS=-lgss -lfl -lintl -lnsl 

CPPFLAGS= -I/var/tmp/gnusql-0.7b5/src/trl -I/var/tmp/gnusql-0.7b5/src/engine -I. -I/var/tmp/gnusql-0.7b5/src/include -I/var/tmp/gnusql-0.7b5/src/include/engine
CFLAGS= -Wall -g3 -O4 $(CFLAGS1) -DHAVE_CONFIG_H
LDFLAGS= -Wall -g3 -O4  -L$(LIB) -L$(CLNT) $(LDFLAGS1)
LFLAGS=-d8i
YFLAGS=-d -v -t

LD=$(CC) $(LDFLAGS)
ARC=$(ETC)/arc
TOUCH=$(ETC)/Touch

##################################################
#                implicit rules                  #
# ansi to knr rules : wget1.4 style - unused now #
##################################################

._c._o:
	echo --$*
	$(CP) $< $$.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $$.c
	[ ! -f $@ ] || $(RM) $@
	$(MV) $$.c $@

.c._c:
	echo ::$*
	[ ! -f $@ ] || $(RM) $@
	$(A2K) $@

.h._h:
	echo ::$*
	[ ! -f $@ ] || $(RM) $@
	$(A2K) $@

##################################################
#                implicit rules                  #
#            -----standard set-----              #
##################################################

.c.o:
	echo --$*
	[ ! -f $@ ] || $(RM) $@
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<

.y.c:
	[ ! -f $@   ] || $(RM) $@
	[ ! -f $*.h ] || $(RM) $*.h
	$(YACC) $(YFLAGS) $< 
	[ ! -f y.tab.c ]  || $(MV)  y.tab.c $*.c
	[ ! -f y.tab.h ]  || $(MV)  y.tab.h $*.h
	[ ! -f $*.tab.c ] || $(MV) $*.tab.c $*.c
	[ ! -f $*.tab.h ] || $(MV) $*.tab.h $*.h
	[ ! -f $(srcdir)/y.tab.c ]  || $(MV) $(srcdir)/y.tab.c $*.c
	[ ! -f $(srcdir)/y.tab.h ]  || $(MV) $(srcdir)/y.tab.h $*.h
	[ ! -f $(srcdir)/$*.tab.c ] || $(MV) $(srcdir)/$*.tab.c $*.c
	[ ! -f $(srcdir)/$*.tab.h ] || $(MV) $(srcdir)/$*.tab.h $*.h
	$(A2K) $*.h $*.c

.l.c:
	[ ! -f $@ ] || $(RM) $@
	$(LEX) $(LFLAGS) -t $< > $@
	$(A2K) $@

.k.c:
	echo ..$*
	[ ! -f $*.c ] || $(RM) $*.c
	[ ! -f $*.h ] || $(RM) $*.h
	$(KITTY) $<
	$(A2K) $@

.a.a_stamp :
	echo -- refreshing $<
	$(RANLIB) $<
	[ ! -f $@ ] || $(RM) $@
	echo .>$@

maintarget : announce all

clean:: announce
	- $(ETC)/make-util clean "$(MAKECLEAN)"

announce   :
	echo "++ `pwd` processed"
force      :
#	echo do nothing
$(LIBSER)_stamp : $(LIBSER)
$(LIBCLI)_stamp : $(LIBCLI)

$(LIBSER)  : libgss_ser
	$(ARC) $@ libgss_ser
$(LIBCLI)  : libgss_cli
	$(ARC) $@  libgss_cli
libgss_ser :
libgss_cli : 
libgss     : 

.SUFFIXES  :  .x .kt .k .y .l .c .h .def ._c .o ._o .a .a_stamp
.FORCE     :
.SILENT    :
.PRECIOUS  : $(LIBSER) $(LIBCLI)


