www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/12/16:32:07

Message-Id: <199902122130.QAA18640@delorie.com>
From: Robert Hoehne <robert DOT hoehne AT gmx DOT net>
Organization: none provided
To: djgpp AT delorie DOT com
Date: Fri, 12 Feb 1999 22:31:24 +0100
MIME-Version: 1.0
Subject: Re: Adding new file extension to RHIDE
In-reply-to: <36C3D94D.8E3B81D8@post.comstar.ru>
X-mailer: Pegasus Mail for Win32 (v3.01d)
Reply-To: djgpp AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019