#
# Makefile for the project "dbtext" und "textdb"
#
# Copyright (C) 2001 Heimo Schön <heimo.schoen@gmx.at>
#
# 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 and NOT 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#

	   CC		 = gcc
           CFLAGS        = -pedantic -Wall -O0 -I/usr/include
	   HARBOUR	 = hbmk2
#           HBFLAGS       = -cflag=-I/usr/include -i./include/ -info -rebuildall -beep -trace -fullstatic -main=fstest
           HBFLAGS       = -cflag=-I/usr/include -i./include/ -info -static
           LDOPTIONS     = -g
	   RM            = rm -f
	   AR            = ar
	   CP            = cp -v
	   STRIP         = strip --verbose

           DBTEXTSRCS    = dbtext.prg
           DBTEXTOBJS    = $(patsubst %.prg,%.o,$(DBTEXTSRCS))

           TEXTDBSRCS    = textdb.prg
           TEXTDBOBJS    = $(patsubst %.prg,%.o,$(TEXTDBSRCS))


all:: dbtext textdb

dbtext: $(DBTEXTSRCS) $(DEPLIBS)
	$(RM) $@
#	export HB_INSTALL_PREFIX=/home/heimo/entwicklungen/hzg/harbour-compiler/harbour-3.0.0/
	export HB_INSTALL_PREFIX=/home/heimo/entwicklungen/hzg/harbour/
	$(HARBOUR) $(HBFLAGS) $(DBTEXTSRCS)

textdb: $(TEXTDBSRCS) $(DEPLIBS)
	$(RM) $@
#	export HB_INSTALL_PREFIX=/home/heimo/entwicklungen/hzg/harbour-compiler/harbour-3.0.0/
	export HB_INSTALL_PREFIX=/home/heimo/entwicklungen/hzg/harbour/
	$(HARBOUR) $(HBFLAGS) $(TEXTDBSRCS)

start: all
	./s

clean::
	$(RM) dbtext textdb *.o *~ TAGS dbtextma.* textdbma.* dbtext.c textdb.c

depend::
	@if [ -n "$(DBTEXTSRCS)" ] ; then set -x;\
	  $(DEPEND) $(DEPENDFLAGS) $(DBTEXTSRCS);\
	fi
	@if [ -n "$(TEXTDBSRCS)" ] ; then set -x;\
	  $(DEPEND) $(DEPENDFLAGS) $(TEXTDBSRCS);\
	fi
