From c09b6e2f1b34ea1925e8ff2678811b40bc23f5ca Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 21 Jul 2018 01:47:33 -0500 Subject: [PATCH] libCom: Add and use a -o option to e_flex Note that like the -S option the filename must follow immediately in the same command-line argument with no space. --- configure/RULES_BUILD | 6 ++---- src/libCom/flex/flex.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index cec33eca7..1c38eef4c 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -256,15 +256,13 @@ YACCOPT ?= $($*_YACCOPT) $(MV) $*.tab.c $*.c $(if $(findstring -d, $(YACCOPT)),$(MV) $*.tab.h $*.h,) -# must be a seperate rule since when not using '-d' the +# must be a separate rule since when not using '-d' the # prefix for .h will be different then .c %.h : %.c %.y %.c: %.l - @$(RM) $*.yy.c - $(LEX) $(LEXOPT) -t $< > $*.yy.c @$(RM) $@ - $(MV) $*.yy.c $@ + $(LEX) $(LEXOPT) -o$@ $< #--------------------------------------------------------------- # Libraries, shared/DLL and stubs diff --git a/src/libCom/flex/flex.c b/src/libCom/flex/flex.c index 196f4e4cc..8d0400c2b 100644 --- a/src/libCom/flex/flex.c +++ b/src/libCom/flex/flex.c @@ -4,7 +4,7 @@ * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. * EPICS BASE is distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* in file LICENSE that is included with this distribution. \*************************************************************************/ /* flex - tool to generate fast lexical analyzers */ @@ -14,7 +14,7 @@ * * This code is derived from software contributed to Berkeley by * Vern Paxson. - * + * * The United States Government has rights in this work pursuant * to contract no. DE-AC03-76SF00098 between the United States * Department of Energy and the University of California. @@ -495,6 +495,13 @@ void flexinit(int argc, char **argv) /* stupid do-nothing deprecated option */ break; + case 'o': + if ( i != 1 ) + flexerror( "-o flag must be given separately" ); + + outfile = arg + i + 1; + goto get_next_arg; + case 'p': performance_report = true; break;