#
# This file is part of GNU Enterprise.
#
# GNU Enterprise 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, or (at your option) any later version.
#
# GNU Enterprise 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 program; see the file COPYING. If not,
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
# Copyright 2001-2004 Free Software Foundation
#
# $Id: Makefile 5347 2004-03-18 10:59:58Z johannes $
# 

# Which scripter to use
SCRIPTER = $(shell type -p "gsscvs")
ifeq ($(SCRIPTER),)
  SCRIPTER = $(shell type -p "gnue-schema")
endif

# Which processors to use
PROCESSORS = postgresql interbase oracle mysql mssql 

HTML = schema.html

# Which files to process
SRC        = sample.gsd

OPTS = 

# Encoding: set encoding to 'latin1', default is UTF-8
# OPTS = --encoding latin1

# ---------------------------------------------------------------------------
# Rules to build all SQL files
# ---------------------------------------------------------------------------

.PHONY: all clean html

all: $(PROCESSORS) html

$(PROCESSORS):
	rm -f $@.sql
	$(SCRIPTER) $(OPTS) --vendor=$@ --output=$@.sql $(SRC)

html: 
	$(SCRIPTER) $(OPTS) --vendor=HTML --output=$(HTML) $(SRC)

clean:
	rm -f *.sql *.html
