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

# Version number of these programs
VERSION = 2

SRCS = glassme.p gme00 gme01 gme02 gme03 gme04 gme05 gme06 gme07 gme08\
                 gme09 gme10 gme11 gme12 gme13 gme14
DOC =  

SKELFILES = make.local

JUNK = gme00.o gme01.o gme02.o gme03.o gme04.o gme05.o gme06.o gme07.o gme08.o\
       gme09.o gme10.o gme11.o gme12.o gme13.o gme14.o gme15.o testout  testout1

TESTFILES = goodin goodout
TEST= 
MAKEFILE = Makefile

 
DISTFILES = ${SRCS} ${HDRS} ${TESTFILES} ${DOC} ${MAKEFILE} 
default:all

#++ 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 $(PROGRAMS)$(VERSION).tar

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

# Non-standard make rules
###
 
# Rules to make the parser and macro expander  #

all: $(PROGRAMS)

# Macro expander
glassme: $(SRCS)
	glammar -d -p glassme 
test:
	glassme goodin testout1
	tail +10 testout1 >testout
	cmp testout goodout
tex:
	cat gme?? | glammar-pp -h1 - macro-expander.tex
