#  Makefile_inc from ObjectProDSP 0.1
#  Copyright (C) 1994, Mountain Math Software, All rights reserved.
#  Licensed for free use and distribution under version 2 of the Gnu General
#  Public License. Please see file COPYING for details and restrictions.
#  
#  ObjectProDSP is a trademark of Mountain Math Software.
#  

ifeq (${LOCAL_DIR},${MAIN_DIR})
# -d generates menu_b.tab.h, -v generates y.output
${MAIN_DIR}/menu_b.tab.h ${MAIN_DIR}/menu_b.tab.C: ${MAIN_DIR}/menu_b.y 
	cd ${MAIN_DIR}/${SUB_DIR} ; bison -d ${MAIN_DIR}/menu_b.y
	cd  ${MAIN_DIR} ; mv  menu_b.tab.c menu_b.tab.C
else
#this is so depedencies for make files in other directories will work
${MAIN_DIR}/menu_b.tab.h : ${MAIN_DIR}/menu_b.y 
	cd ${MAIN_DIR}/${SUB_DIR} ; make menu_b.tab.o
endif

yacc.line : ${MAIN_DIR}/menu_b.tab.C
	fgrep -v '# line' ${MAIN_DIR}/menu_b.tab.C > ytab.C
	mv ytab.C ${MAIN_DIR}/menu_b.tab.C
	make menu_b.tab.o

${MAIN_DIR}/lex.yy.C: ${MAIN_DIR}/menuprs.l
	cd ${MAIN_DIR}/${SUB_DIR} ; flex ${MAIN_DIR}/menuprs.l
	cd ${MAIN_DIR}/${SUB_DIR} ; mv lex.yy.c ${MAIN_DIR}/lex.yy.C

