#
#   Makefile.fpc for Pascal lex/yacc
#

[targets]
programs=plex pyacc
units=lexlib yacclib

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

[dirs]
fpcdir=../..

[require]
options=-Sg


[rules]
pyacc$(EXEEXT): pyacc$(PASEXT) $(wildcard yacc*$(PASEXT))
        $(COMPILER) pyacc$(PASEXT) $(REDIR)

plex$(EXEEXT): plex$(PASEXT) $(wildcard lex*$(PASEXT))
        $(COMPILER) plex$(PASEXT) $(REDIR)

lexlib$(PPUEXT): lexlib$(PASEXT)

yacclib$(PPUEXT): yacclib$(PASEXT)

ifdef UNIXINSTALLDIR
CODPATH=$(PREFIXINSTALLDIR)/lib/fpc/lexyacc
else
CODPATH=$(BININSTALLDIR)
endif

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