# $XFree86: doctools/sgmlformat/Makefile,v 1.7 1998/11/01 12:12:19 dawes Exp $

SHELL=/bin/sh

# These are defaults which are normally overriden
PREFIX=/usr/local
INSTALL = install
TRANSPEC_DIR = $(PREFIX)/share/sgml/transpec
TMAC_DIR = $(PREFIX)/share/sgml/tmac
PERLCMD = /usr/local/bin/perl

MDEFS = 'PREFIX=$(PREFIX)' 'INSTALL=$(INSTALL)' \
	'BINDIR=$(BINDIR)' 'PERLCMD=$(PERLCMD)' \
	'CC=$(CC)' 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'EXTRALIBS=$(EXTRALIBS)' \
	'TRANSPEC_DIR=$(TRANSPEC_DIR)' 'TMAC_DIR=$(TMAC_DIR)' \
	'TOPDIR=$(TOPDIR)' 'REGEXLIB=$(REGEXLIB)'

SUBDIRS = instant transpec sgmlfmt tmac

all:
	mydir=`pwd`; \
	for i in $(SUBDIRS); do \
	  echo "Making all in $$i ..."; \
	  cd $$i; $(MAKE) $(MDEFS) all; \
	  cd $$mydir; \
	done

install:
	mydir=`pwd`; \
	for i in $(SUBDIRS); do \
	  echo "Installing in $$i ..."; \
	  cd $$i; $(MAKE) $(MDEFS) install; \
	  cd $$mydir; \
	done

clean:
	mydir=`pwd`; \
	for i in $(SUBDIRS); do \
	  echo "Cleaning in $$i ..."; \
	  cd $$i; $(MAKE) $(MDEFS) clean; \
	  cd $$mydir; \
	done

