# Makefile to build the parser and macro expander
# Name of these programs

# Version number of these programs
PROGRAM=test-glass
VERSION=2


SKELFILES = make.local

MAKEFILE=Makefile

xxxx:all

DISTFILES = ${SRCS} ${HDRS} ${TESTFILES} ${DOC} ${MAKEFILE}

#++ 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. ++


# Add rules for the programs themselves here.
all:  $(PROGRAM)

$(PROGRAM): Makefile
	echo '#\!/bin/csh' > $(PROGRAM)
	echo 'foreach i (*.gl)' >> $(PROGRAM)
	echo 'echo compiling $$i ...' >> $(PROGRAM)
	echo 'if (! -e   $$i.sf )  $(BDIR)/glass $$i' >> $(PROGRAM)
	echo '$(BDIR)/glassup $$i.sf $$i.log' >> $(PROGRAM)
	echo '/bin/rm  $$i.sf' >> $(PROGRAM)
	echo "echo comparing..." >> $(PROGRAM)
	echo 'if (! -e   $$i.gl)  continue' >> $(PROGRAM)
	echo 'cmp $$i.log  $$i.gl' >> $(PROGRAM)
	echo 'if ($$status > 0) echo Huh...' >> $(PROGRAM)
	echo 'end' >> $(PROGRAM)
	chmod 755 $(PROGRAM) 

install:  all
 
clean:
	rm -f *.log *.sf test-glass 

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

tar:
	tar -cf $(PROGRAM)$(VERSION).tar $(DISTFILES) 
	compress $(PROGRAM)$(VERSION).tar

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

# Non-standard make rules
###
 
test:  test-glass
	csh test-glass > test.log
