# $Id: Makefile,v 1.10.1.1 1992/11/09 22:47:38 kadhim Exp $

# =======================================================
# makefile parameters to be adapted:

# destination directory for installation:
DESTDIR=	../../..

DIR=		Tool/lib/Examp

# Eli installation to be used for producing the example
ELI=	/comp/3.3

CACHE=	CACHE

# =======================================================
# subdirectories:

# =======================================================
# sources:
SRC=	Makefile TRES.cmp derive \
	Id.gla \
	ExChain.err      ExFwd.lido       ExLeafPtg.ok \
	ExChain.lido     ExFwd.ok         ExLeafPtg.ptg \
	ExChain.ok       ExFwd.specs      ExLeafPtg.specs \
	ExChain.specs    ExGenName.lido   ExNest.err \
	ExCnt.lido       ExGenName.ok     ExNest.lido \
	ExCnt.ok         ExGenName.specs  ExNest.ok \
	ExCnt.specs      ExIndent.lido    ExNest.specs \
	ExDefPt.err      ExIndent.ok      ExNestFlat.err \
	ExDefPt.lido     ExIndent.ptg     ExNestFlat.lido \
	ExDefPt.ok       ExIndent.specs   ExNestFlat.ok \
	ExDefPt.specs    ExKind.err       ExNestFlat.specs \
	ExField.err      ExKind.head      ExOnce.lido \
	ExField.lido     ExKind.lido      ExOnce.ok \
	ExField.ok       ExKind.ok        ExOnce.specs \
	ExField.pdl      ExKind.specs     ExTree.lido \
	ExField.specs    ExLeafPtg.gla    ExTree.ok \
	ExFwd.err        ExLeafPtg.lido   ExTree.specs

# =======================================================
# results of making:

# =======================================================
# dependencies:

all:	TESTDIF

TESTDIF:	TRES TRES.cmp
	rm -f TESTDIF TTT XXX YYY ZZZ
	echo `pwd` >XXX
	sed -e 's?/tmp_mnt??' XXX >YYY
	echo "s?"`cat YYY`"/??" >ZZZ
	sed -f ZZZ TRES >TTT
	diff TTT TRES.cmp > TESTDIF
	rm -f TTT XXX YYY ZZZ

TRES:	$(SRC) $(CACHE)
	rm -f TRES TOUT
	$(DESTDIR)/bin/eli -c $(CACHE) <derive

$(CACHE):
	$(DESTDIR)/bin/eli -c $(DESTDIR) -n $(CACHE) -q

# =======================================================
# cleaning:

# clean any files created by make, but not needed to execute this tool:

tidy:
	rm -rf core *~ *% XXX YYY ZZZ TTT TESTDIF TRES TOUT $(CACHE)


# clean any files created by make:

clean:
	rm -rf $(CACHE) core *~ *% XXX YYY ZZZ TTT TESTDIF TRES TOUT

# ========================================================
# installation:

install:	$(SRC)
	@cp $(SRC) $(DESTDIR)/$(DIR)
	@cd $(DESTDIR)/$(DIR); chmod 0644 $(SRC)

distrib:	install

executable:	tidy

# ========================================================
# rcs operations for the development directory (RCS in each subdirectory):

RCSSYS=		/usr/local/gnu/rcs/bin
RCSFLAGS=	-q
RCSCMD=		co

comakefile:

rcs:	RCS
	@echo "$(RCSCMD) in Examp"
	@-$(RCSSYS)/$(RCSCMD) $(RCSFLAGS) $(SRC)

RCS:
	@mkdir RCS
