#
# During initial installation SRCDIR, LIBDIR & BINDIR
# can be over-ridden by macros give to the make command
#
# Modify if include files live in /usr/include/HRPC/
INCLDIR= -I..
#
# Pathname to the ASCII interface database file.  Used
# by the stub generator during DEPENDS UPON processing.
IFLIST = /usr/include/HRPC/Interfaces/interfaceList
#
CFLAGS = -O ${INCLDIR}
LDFLAGS =
BINDIR = .
SRCDIR = .
LIBDIR =
LIBS = -ll

OBJS = checktype.o constants.o constantcode.o code.o lex.yy.o main.o \
	misc.o prognums.o procedures.o symbols.o types.o typecode.o y.tab.o \
	getcservice.o getcourierent.o GetTypeUID.o fileaccess.o \
	fileprocedures.o languages.o lispcode.o Lproccode.o Cproccode.o

FILES = checktype.c constants.c constantcode.c code.c main.c \
	misc.c prognums.c procedures.c symbols.c types.c typecode.c \
	getcservice.c getcourierent.c compiler.h scanner.l courier.y \
	fileaccess.c GetTypeUID.c fileprocedures.c courierdb.h \
	lispcode.c Lproccode.c languages.c Cproccode.c

hrpcstubs: $(OBJS)
	cc $(CFLAGS) -o hrpcstubs $(OBJS) $(LIBS)

getcourierent.o: getcourierent.c
	cc -c -O -DCSERVICES=\"${IFLIST}\" getcourierent.c

y.tab.h y.tab.c: courier.y
	@echo expect one shift/reduce conflict
	yacc -d courier.y

lex.yy.c: scanner.l
	lex scanner.l

$(OBJS): compiler.h
lex.yy.o: y.tab.o

GetTypeUID.o:	GetTypeUID.c
	cc -c -O ${INCLDIR} -DBOOTVERS GetTypeUID.c

fileaccess.o:	fileaccess.c
	cc -c -O ${INCLDIR} -DBOOTVERS fileaccess.c

fileprocedures.o: fileprocedures.c
	cc -c -O ${INCLDIR} -DBOOTVERS fileprocedures.c

clean:
	-rm -f $(OBJS) lex.yy.c y.tab.c y.tab.h *.bak *.ckp hrpcstubs

install: hrpcstubs
	mv hrpcstubs /usr/local/


