#
#   Makefile.fpc for Pascal lex/yacc
#

[target]
programs=plex pyacc
units=lexlib yacclib

[clean]
units=lexbase lexopt lexdfa lexpos lexlist lexrules lexmsgs lextable \
      yaccbase yaccmsgs yaccclos yaccpars yacclook yaccsem yacclr0 yacctabl

[compiler]
options=-Sg

[install]
fpcpackage=y

[default]
fpcdir=../..


[rules]
pyacc$(EXEEXT): pyacc.pas $(wildcard yacc*.pas)
        $(COMPILER) pyacc.pas

plex$(EXEEXT): plex.pas $(wildcard lex*.pas)
        $(COMPILER) plex.pas

lexlib$(PPUEXT): lexlib.pas

yacclib$(PPUEXT): yacclib.pas

ifdef UNIXINSTALLDIR
CODPATH=$(INSTALL_PREFIX)/lib/fpc/lexyacc
else
CODPATH=$(INSTALL_BINDIR)
endif

install: fpc_install
        $(MKDIR) $(CODPATH)
        $(COPY) yylex.cod yyparse.cod $(CODPATH)
