# Generated automatically from Makefile.in by configure.
#
# Makefile for tablelib directory
# Generated from tablelib/Makefile.in
# Daniel Veillard, 1997
#

VPATH= ../../tablelib
THOTDIR = ../..

include ../Options

INCLUDES= -DHAVE_CONFIG_H -I.. -I../../tablelib/f -I$(THOTDIR)/thotlib/include -I$(THOTDIR)/thotlib/internals/var -I$(THOTDIR)/thotlib/internals/h -I$(THOTDIR)/thotlib/internals/f -I$(THOTDIR)/schemas -I$(THOTDIR)/schemasOPERA -I$(THOTDIR)/libjpeg -I$(THOTDIR)/libpng -I$(THOTDIR)/libpng/zlib $(X_FLAGS)

prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib

#
# Rule to build objects
#
.c.o :
	$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

all : libThotTable.a

clean :
	$(RM) libThotTable.a
	$(RM) *.o

install : all
	@(if test ! -d $(libdir) ; then $(MKDIR) $(libdir) ; fi)
	$(INSTALL_DATA) libThotTable.a $(libdir)

uninstall :
	$(RM) -f $(libdir)/libThotTable.a

include .depends

../tools/mkdep/mkdep : 
	@(cd ../tools/mkdep ; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)")

.depends depend : ../tools/mkdep/mkdep
	../tools/mkdep/mkdep -relative -vpath $(VPATH) $(INCLUDES) $(VPATH)/*.c  > .depends

#########################################################################
#									#
#		Rules to build the library				#
#									#
#########################################################################

TABLE_OBJ = \
	table.o \
	table2.o

libThotTable : libThotTable.a

libThotTable.a : $(TABLE_OBJ)
	$(AR) libThotTable.a $(TABLE_OBJ)
	$(RANLIB) libThotTable.a


CEXTRACT= ../bin/cextract

$(CEXTRACT) :
	@(cd ../tools/cextract-$(CEXTRACT_VER) ; $(MAKE) )

proto : ../bin/cextract
	@(for i in ../../tablelib/*.c ; \
	  do \
	  dir=`dirname $$i`;base=`basename $$i .c`; \
	  if [ ! -d $$dir/f ] ; then $(MKDIR) $$dir/f ;fi;\
	  $(CEXTRACT) $(CEXTRACT_FLAGS) -o /tmp/cextract.$$base.$$$$ $$i 2> /dev/null ; \
	  if [ -f $$dir/f/"$$base"_f.h ] ; \
	  then \
	      delta=`$(DIFF) /tmp/cextract.$$base.$$$$ $$dir/f/"$$base"_f.h` ; \
	      if [ "$$delta" != "" ] ; \
	      then \
	          echo "  $$i proto changed" ; \
		  $(MV) /tmp/cextract.$$base.$$$$ $$dir/f/"$$base"_f.h ; \
              else \
	          $(RM) /tmp/cextract.$$base.$$$$ ; \
	      fi ; \
	  else \
	      echo "  $$i proto added" ; \
	      $(MV) /tmp/cextract.$$base.$$$$ $$dir/f/"$$base"_f.h ; \
	  fi ; \
	 done)

