# Imakefile for term parser library and its application called `term2lisp'
#
LEX = ../flex-2.3.7/flex -S../flex-2.3.7/flex.skel
LFLAGS = -8
YFLAGS = -d

LIBOBJS = term_yacc.o term_lex.o term.o unparse_lisp.o
OBJS = term2lisp.o term_yacc.o term_lex.o term.o unparse_lisp.o
LIBS = -lterm

LOCAL_LDFLAGS = -L./

LDFLAGS = DefaultLdFlags ${LOCAL_LDFLAGS}

MakefileTarget()

all: libterm.a term2lisp

MakeLibrary(libterm.a,${LIBOBJS})
MakeTarget(term2lisp,${OBJS},${LIBS})

#ifdef BSD
InstallTargetWithFlags(install,term2lisp,${QXTLIB},-m 0775)
#else
InstallTargetWithFlags(install,term2lisp,${QXTLIB},NULLARG)
#endif

CleanTarget()

clean::
	-${RM} -f libterm.a term2lisp

term_lex.o : 

term_lex.c  : term_yacc.h term.h
	$(RM) term_lex.c
	$(LEX) $(LFLAGS) term_lex.l
	$(MV) lex.yy.c term_lex.c

term_yacc.h term_yacc.c: term_yacc.y
	$(RM) term_yacc.c	
	$(YACC) $(YFLAGS) term_yacc.y
	$(MV) y.tab.c term_yacc.c
	$(MV) y.tab.h term_yacc.h
