/*  Imakefile for Andrew Consortium's bison-A2.0
*/

/*  installed names of parser files  */
PFILE = bison.simple
PFILE1 = bison.hairy

DEFINES  =  -DXPFILE='((char*)AndrewDir('\"/etc/$(PFILE)\"'))' \
	 -DXPFILE1='((char*)AndrewDir('\"/etc/$(PFILE1)\"'))'

OBJECTS = LR0.o allocate.o closure.o conflicts.o derives.o files.o	\
	  getargs.o getopt.o getopt1.o gram.o lalr.o lex.o		\
	  main.o nullable.o output.o print.o reader.o reduce.o symtab.o	\
	  version.o warshall.o

NormalObjectRule()

/*  make and install the program */
ProgramTarget(bison, $(OBJECTS),  $(UTILLIB), )
InstallProgram(bison, ${DESTDIR}/bin)

/*  install documents  
bison.info: bison.texinfo
	makeinfo bison.texinfo */

/* InstallDocs(bison.1, ${DESTDIR}/doc/syntax) 
InstallDocs(bison.info bison.info-?, ${DESTDIR}/doc/syntax) */

/*  install the bison parsers  */
/*  Copy bison.simple, inserting directory name into the #line commands. */ 
tmp-simple: bison.simple
	sed -e "/^#line/ s|bison|$(DESTDIR)/etc/bison|" 	\
			< bison.simple   > tmp-simple
InstallFileToFile(tmp-simple, ${INSTLIBFLAGS}, ${DESTDIR}/etc/${PFILE})
InstallFiles(${PFILE1}, ${INSTLIBFLAGS}, ${DESTDIR}/etc)

CleanTarget(config.status tmp-simple ness.tab* ness.act *.output *.guard.c *.stype.h)

DependTarget()


/* to make the Bison distribution files in familiar gnu form,
	we delete three files and
	convert all instances of sys.h to system.h
*/
distribution: clean
	rm -f RCS Imakefile Makefile ness.y 
	mv sys.h system.h
	for f in Makefile.in *.c; do \
		(sed "/andrewos.h/s/andrewos.h/system.h/" $$f > $$f.s ; \
			rm -f $$f; mv $$f.s $$f) done
