# Makefile to build the script linking all parts of the environment
# Name of these programs
PROGRAM=glass

# Version number of these programs
VERSION=3

SRCS=glass 

DOC=  glass.1 adderind.gl index.mac

SKELFILES = make.local

TESTFILES=goodin.gl goodout
TEST=
JUNK= goodin.sf goodin.listing
MAKEFILE=Makefile

xxxx:all

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

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

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

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

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

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

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

#  HOSTNAME : name of installation machine.
HOSTNAME=phoibos

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

# CLIBLOC : required C libraries
CLIBLOC =

LINTLIBLOC =

PASLIBLOC =

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

SYSLINTFLAGS = -hac
SYSCFLAGS =
SYSCPROFFLAGS =
SYSCDBUGFLAGS =
SYSPFLAGS =

# 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)
	ranlib $(LDIR)/$(MODULE)
#++ make module local end, do NOT touch this line. ++


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

$(PROGRAM): glass-head glass-tail
	cat glass-head > $(PROGRAM)
	echo "set BDIR=$(BDIR)" >> $(PROGRAM)
	echo "set IDIR=$(IDIR)" >> $(PROGRAM)
	cat glass-tail >> $(PROGRAM)
	chmod 755 $(PROGRAM) 

install:  all
	cp $(PROGRAM) $(BDIR)
 
clean:
	rm -f $(JUNK)  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:
	csh glass goodin
	cmp goodin.sf goodout 
