VERSION = 4

DOC	= tmmira.tex plot.ds mirademo.t readin.m miraspec.t CHANGELOG README

TEST    = test.mt testspec.t testtop.m testdata goodout test.ds

CODE    = miraneed.t mira.mt

JUNK = tmp core makelog tmmira.aux tmmira.dvi tmmira.log mirademo.m \
       mirademo.x readin.x test.m test.x testtop.x version.tex testout \
       install tmmira.alw

MAKEFILE = Makefile

TM =tm

DISTFILES = $(DOC) $(CODE) $(MAKEFILE) $(TEST)

#++ make module local start, do NOT touch this line. ++
# Installation dependent make variables for ericv on HERMES 

# full path of the ESPRIT environment
ESPRITDIR = /home1/forfun

#  BDIR     : bin directory
BDIR = $(ESPRITDIR)/binA

#  IDIR     : include directory
IDIR = $(ESPRITDIR)/include

#  LDIR     : library directory
LDIR = $(ESPRITDIR)/libA


NFULLDS = $(ESPRITDIR)/ds/nfullgl.ds
NKERNDS = $(ESPRITDIR)/ds/nkerngl.ds

#  HOSTNAME : name of installation machine.
HOSTNAME=hermes

# SYS     : name of operating system or machine type
#     BSD	For generic BSD systems
#     AVIION	For generic DG_UX systems
#     HPUX	For all HP-UX systems
#     SUN	For all SUN systems
#     APOLLO	For all Apollo systems
SYS = AVIION

# CLIBLOC : required C libraries
CLIBLOC =

LINTLIBLOC =

PASLIBLOC =

# CBADADR : address that will cause a core-dump if read or written.
CBADADR = 0

SYSLINTFLAGS = -hpac
SYSCFLAGS = 
SYSCPROFFLAGS =
SYSCDBUGFLAGS =
SYSPFLAGS =
OFLAG= -O
# Collection of host dependent make rules.

### libinstall ###
# MODULE	- module to install
libinstall:
	cp $(MODULE) $(LDIR)/$(MODULE)

### includeinstall ###
# MODULE	- module to install
includeinstall:
	cp $(MODULE) $(IDIR)/$(MODULE)

### maninstall ###
# MAN		- manual page to install
maninstall:
	cp $(MAN) /usr/man/manl

### bininstall ###
# MODULE	- module to install
bininstall:
	cp $(MODULE) $(BDIR)/$(MODULE)
	strip $(BDIR)/$(MODULE)

### arlibinstall ###
# MODULE	- module to install
arlibinstall:
	cp $(MODULE) $(LDIR)/$(MODULE)

LINK.c=$(CC) 
#++ make module local end, do NOT touch this line. ++

help:
	@echo " Possible make targets:"
	@echo "all		Create local running programs."
	@echo "clean		Free disk space."
	@echo "distfiles	List distribution files."
	@echo "doc		Creat documentation."
	@echo "install		Install relevant files."
	@echo "setup		Adapt sources to local situation."
	@echo "test		Run tests."

all:

test : test.m
	echo "forcecompile" | mira testtop
	echo "testit" | mira testtop > testout
	diff testout goodout

install: miraneed.t mira.mt
	cat miraneed.t mira.mt > $(LDIR)/mira.mt
	touch install

clean:
	rm -f $(JUNK)

distfiles:
	@echo $(DISTFILES) | tr ' ' '\012'

setup:
	modmake local ../make.local $(MAKEFILE)

doc: install version.tex mirademo.m
	latex '\batchmode\input{tmmira}'
	cat tmmira.log

# Non-standard make rules
mirademo.m: mirademo.t plot.ds miraspec.t
	$(TM) plot.ds mirademo.t | expand > mirademo.m

test.m: test.mt test.ds testspec.t miraneed.t mira.mt
	$(TM) test.ds test.mt > test.m

version.tex : $(MAKEFILE)
	echo "\\def\\version{$(VERSION)}" > version.tex

###
