#!/usr/bin/make
#
#  Toplevel makefile for SGMLtools
#
#  $Id: GNUmakefile,v 1.6 1998/11/04 21:21:07 cg Exp $
#
#  SGMLtools - an SGML toolkit.
#  Copyright (C) 1998 Cees A. de Groot
#
#  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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#

.EXPORT_ALL_VARIABLES:

include profile

default: .deps build

build: build-all

install: checkup install-all
	. $(SGML_ETC_DIR)/sgml.conf; eval $$SGML_POSTPROCESS_CMD
	-texhash || mktexlsr

checkup:
	-mkdir $(SGML_PREFIX)
	-mkdir $(SGML_BIN_DIR)
	-mkdir $(SGML_SHARE_DIR)
	-mkdir $(SGML_DOC_DIR)
	-mkdir $(SGML_MAN_DIR)
	-mkdir $(SGML_LIB_DIR)
	/bin/sh tools/checketc.sh

clean: clean-all
	-rm .installed
	-rm -rf .deps

mrproper: clean
	-rm config.* profile

.deps:
	[ ! -d .deps ] && mkdir .deps

Makerules:
	$(PERL) tools/makemake.pl

%.force:
	-rm .deps/$(basename $@ .force)
	$(MAKE) $(basename $@ .force)

include Makerules

