# Put the complete path for the distribution here (i.e. where you are now) 
VY	=	/home/ewhite1/VY

# Put the complete path for the motif libraries
MOTIFLIB        =       -I/usr/dt/include 
MOTIFLIB1        =       -I/usr/openwin/include

# Put the complete path for where you want binaries installed 
INSTALL_BIN =	/home/ewhite1/VY/bin

# Put the complete path for where you want libraries installed 
INSTALL_LIB =	/home/ewhite1/VY/lib





# You should not need to edit anything below this line
NYLIB	=	${INSTALL_LIB}/libny.a

all: software install

software: 	nylibraries script
	(cd TransCode;make NYLIB=${NYLIB} MOTIFLIB=${MOTIFLIB} MOTIFLIB1=${MOTIFLIB1})
	(cd PreProcess/Lex;make)
	(cd PreProcess/Yacc;make NYLIB=${NYLIB})

nylibraries:	.nybuilt
	(cd libny; make)
	cp libny/libny.a ${INSTALL_LIB}

	

script:	
	rm -f visual_yacc
	echo "#!/bin/csh -f" > visual_yacc
	echo "" >> visual_yacc
	echo "   set VY\t=\t" ${VY} >> visual_yacc 
	echo "   set MOTIF_LIB\t=\t(" ${MOTIFLIB} " " ${MOTIFLIB1} ")"  >> visual_yacc 
	echo "   set INSTALL_BIN\t=\t" ${INSTALL_BIN} >> visual_yacc 
	echo "   set INSTALL_LIB\t=\t" ${INSTALL_LIB} >> visual_yacc 
	echo "" >> visual_yacc
	cat Include/base >> visual_yacc
	chmod +x visual_yacc

install: PreProcess/Lex/fix_lex PreProcess/Yacc/pre_vyacc	
	mv PreProcess/Lex/fix_lex ${INSTALL_BIN}
	mv PreProcess/Yacc/pre_vyacc ${INSTALL_BIN}
	mv TransCode/vyacc ${INSTALL_BIN}
	mv TransCode/libvyacc.a ${INSTALL_LIB}
	mv libny/libny.a ${INSTALL_LIB}

clean:	
	(cd TransCode; make clean)
	(cd PreProcess/Lex; make clean)
	(cd PreProcess/Yacc; make clean)

realclean:	
	(cd PreProcess/Lex; make realclean)
	(cd libny; make realclean)
	(cd PreProcess/Yacc; make realclean)
	rm -f .nybuilt
	rm -f visual_yacc

.nybuilt:	
	touch .nybuilt

