Mail Archives: djgpp/1999/02/12/16:32:07
> Hi,
> What should I do to tell RHIDE what files in project with
> .y extension should be parsed by bison -dt and
> with .lex one by flex -B
> Thanks in advance.
Add the following lines to either your global rhide.env
or only in the directory where you want to use it. The
specs below assume, that you have installed the mv.exe
If not, either install them or checnge the "mv" to "ren".
# declare at first the final C source file
tmp_c_source=$(setsuffix .c,$(notdir $(SOURCE_NAME)))
# Spec to move the bison output to the C source file
tmp_mv_y_c=mv y_tab.c $(tmp_c_source)
# Spec to move the bison produced header file
tmp_mv_y_h=mv y_tab.h $(setsuffix .h,$(notdir $(SOURCE_NAME)))
# Do the above two specs in one command line
tmp_mv_y=$(tmp_mv_y_c); $(tmp_mv_y_h)
# Spec, how to compile with bison
RHIDE_COMPILE_BISON_Y=bison -y -td $(SOURCE_NAME)
# Spec how to compile the C source
RHIDE_COMPILE_BISON_C=$(subst $(SOURCE_NAME),$(tmp_c_source),$(RHIDE_COMPILE_C))
# Now the complet spec to compile a .y file into a .o file
RHIDE_COMPILE_BISON=$(RHIDE_COMPILE_BISON_Y); $(tmp_mv_y); $(RHIDE_COMPILE_BISON_C)
# Now telling RHIDE to use the rule for compiling from .y to .o
RHIDE_COMPILE.y.o=$(RHIDE_COMPILE_BISON)
# Spec how to call flex
RHIDE_COMPILE_L=flex -B -o$(tmp_c_source) $(SOURCE_NAME)
# SPec to compile the flex produced source file
RHIDE_COMPILE_L_C=$(subst $(SOURCE_NAME),$(tmp_c_source),$(RHIDE_COMPILE_C))
# Now tell RHIDE to use the above spec for compiling .l to .o
RHIDE_COMPILE.l.o=$(RHIDE_COMPILE_L); $(RHIDE_COMPILE_L_C)
Robert
******************************************************
* email: Robert Hoehne <robert DOT hoehne AT gmx DOT net> *
* Post: Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW: http://www.tu-chemnitz.de/~sho/rho *
******************************************************
- Raw text -