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

PROGRAMS = glassp

# Version number of these programs
VERSION = 2

SRCS = glassp.p gpars00 gpars01 gpars02 gpars03 gpars04\
                gpars05 gpars06 gpars07 gpars08
DOC =  
JUNK= gpars00.o gpars01.o gpars02.o gpars03.o gpars04.o\
                gpars05.o gpars06.o gpars07.o gpars08.o testout1 testout
SKELFILES = make.local

TESTFILES = goodin goodout
TEST= 
MAKEFILE = Makefile

 
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.

install: 
	chmod 755 $(PROGRAMS)
	cp $(PROGRAMS) $(BDIR)
 
clean:
	rm -f $(JUNK) $(OBJS)  $(PROGRAMS)

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

tar:
	tar -cf $(PROGRAMS)$(VERSION).tar $(DISTFILES) 
	compress -f $(PROGRAMS)$(VERSION).tar

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

# Non-standard make rules
###
 

all: $(PROGRAMS)

# Parser  
glassp: $(SRCS)
	glammar -d -p glassp 
test:
	glassp goodin testout1
	tail +5 testout1 >testout   # strip first lines containing date
	cmp testout goodout
tex:
	cat gpars?? | glammar-pp - parser.tex
