[SCM] master: Run each antlr in a separate directory (fix a parallel make problem).

cagney@sourceware.org cagney@sourceware.org
Thu Nov 15 02:07:00 GMT 2007


The branch, master has been updated
       via  adb971cd44b8398b4f64cecb699ff2c3be8620aa (commit)
      from  29571987fd50faeb9acb929da80887508c2b3dd3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit adb971cd44b8398b4f64cecb699ff2c3be8620aa
Author: Andrew Cagney <cagney@redhat.com>
Date:   Wed Nov 14 21:03:56 2007 -0500

    Run each antlr in a separate directory (fix a parallel make problem).
    
    frysk-common/ChangeLog
    2007-11-14  Andrew Cagney  <cagney@redhat.com>
    
    	* Makefile.rules (.g.antlred): Rename .g.antlered; use a tmp
    	directory named according to the target.
    	(javah-built): Delete.
    	(ANTLR): Define.
    	* Makefile.gen.sh: Rename .antlered to .antlred.  Include
    	*TokenTypes.txt in list of generated files.
    
    frysk-core/ChangeLog
    2007-11-14  Andrew Cagney  <cagney@redhat.com>
    
    	* Makefile.am (ANTLR): Delete.

-----------------------------------------------------------------------

Summary of changes:
 frysk-common/ChangeLog                 |    7 +
 frysk-common/Makefile.gen.sh           |   29 +++--
 frysk-common/Makefile.rules            |   39 +++---
 frysk-core/ChangeLog                   |    4 +
 frysk-core/Makefile.am                 |    2 -
 frysk-core/frysk/expr/CExprAnnotator.g |  238 --------------------------------
 frysk-core/frysk/expr/ChangeLog        |    4 +
 7 files changed, 51 insertions(+), 272 deletions(-)
 delete mode 100644 frysk-core/frysk/expr/CExprAnnotator.g

First 500 lines of diff:
diff --git a/frysk-common/ChangeLog b/frysk-common/ChangeLog
index fe2df45..df27d16 100644
--- a/frysk-common/ChangeLog
+++ b/frysk-common/ChangeLog
@@ -1,5 +1,12 @@
 2007-11-14  Andrew Cagney  <cagney@redhat.com>
 
+	* Makefile.rules (.g.antlred): Rename .g.antlered; use a tmp
+	directory named according to the target.
+	(javah-built): Delete.
+	(ANTLR): Define.
+	* Makefile.gen.sh: Rename .antlered to .antlred.  Include
+	*TokenTypes.txt in list of generated files.
+
 	* Makefile.rules (built-sources): New.
 	($(SCRIPT_BUILT)): New.
 	($(JAVAH_BUILT)): New.
diff --git a/frysk-common/Makefile.gen.sh b/frysk-common/Makefile.gen.sh
index 11f71da..da6b5fc 100755
--- a/frysk-common/Makefile.gen.sh
+++ b/frysk-common/Makefile.gen.sh
@@ -659,20 +659,25 @@ grep -e '\.g$' files.list | while read g
 do
   d=`dirname $g`
   b=`basename $g .g`
-  echo "CLEANFILES += $d/$b.antlered"
+  echo "CLEANFILES += $d/$b.antlred"
   echo "CLEANDIRS += $d/$b.tmp"
-  IMPORTVOCAB=$(awk -v DIR=$d -F = '/importVocab/ {gsub("Parser;",".antlered",$2);printf "%s/%s ",DIR,$2}' $g)
-  echo "$d/$b.antlered: $g ${IMPORTVOCAB}"
-  (
-      awk '/class/ { print $2 }' $g
-      awk '/class .* extends .*Parser/ { print $2"TokenTypes" }' $g
-  ) | while read c
+  awk '
+BEGIN { FS = "=" }
+/importVocab/ {
+    gsub(";","",$2)
+    print "'$d/$b'.antlred: '$d'/" $2 "TokenTypes.txt"
+}' $g
+  awk '
+/class/ { print $2 ".java" }
+/class .* extends .*Parser/ { print $2 "TokenTypes.java" }
+/class .* extends .*Parser/ { print $2 "TokenTypes.txt" }
+' $g | while read c
   do
-    echo "# Dummy dependency, see implicit .g.antlered for generation"
-    echo "$d/$c.java: $d/$b.antlered"
-    echo "BUILT_SOURCES += $d/$c.java"
-    echo "ANTLR_BUILT += $d/$c.java"
-    echo "${sources} += $d/$c.java"
+    echo "# Dummy dependency, see implicit .g.antlred for generation"
+    echo "$d/$c: $d/$b.antlred"
+    echo "BUILT_SOURCES += $d/$c"
+    echo "ANTLR_BUILT += $d/$c"
+    echo "${sources} += $d/$c"
   done
 done
 
diff --git a/frysk-common/Makefile.rules b/frysk-common/Makefile.rules
index 949bd0c..bae9e3d 100644
--- a/frysk-common/Makefile.rules
+++ b/frysk-common/Makefile.rules
@@ -208,13 +208,6 @@ built-sources: $(BUILT_SOURCES)
 $(ANTLR_BUILT): | $(SCRIPT_BUILT)
 $(JAVAH_BUILT): | $(SCRIPT_BUILT) $(ANTLR_BUILT)
 
-# Ensure all imported .java files have been generated before
-# attempting to run JAVAH/GCJH.
-
-.PHONY: javah-built
-BUILT_SOURCES += javah-built
-javah-built: script-built antlr-built $(JAVAH_BUILT)
-
 
 # Rules for building a .java file from any of a .mkclass file, a
 # .mkenum file, or a .shenum script.  This lets us specify CLASS.java
@@ -490,12 +483,19 @@ endif
 # running the generated files through the compiler and then "fix" the
 # warnings.  Reuse the tmp directory for successive runs on related .g files.
 
-SUFFIXES += .antlered .g
-.g.antlered:
-	mkdir -p $(@D)/antlr.tmp
-	$(ANTLR) -o $(@D)/antlr.tmp \$(srcdir)/$*.g
+ANTLR = $(JAVA) \
+	-classpath @abs_builddir@/../frysk-imports/antlr.jar \
+	antlr.Tool
+
+SUFFIXES += .antlred .g
+.g.antlred:
+	mkdir -p $*.tmp
+	b=`basename $*` ; \
+	d=`dirname $*` ; \
+	cd $$d ; \
+	$(ANTLR) -o $$b.tmp @abs_srcdir@/$*.g
 	@echo "Setting up generated files ..." ; \
-	d=$(@D)/antlr.tmp ; for gen in $$d/*.java ; do \
+	d=$*.tmp ; for gen in $$d/*.java ; do \
 	    b=`basename $$gen .java` ; \
 	    ( set -x ; mv $$gen $$d/$$b.gen ) ; \
 	    ( set -x ; rm -f $$d/../$$b.java ) ; \
@@ -506,7 +506,7 @@ SUFFIXES += .antlered .g
 	        fi ; \
 	    done ; \
 	done
-	@edits=true ; d=$(@D)/antlr.tmp ; \
+	@edits=true ; d=$*.tmp ; \
 	while $$edits ; do \
 	    edits=false ; \
 	    echo "Applying fixes ..." ; \
@@ -551,13 +551,12 @@ SUFFIXES += .antlered .g
 		edits=true ; \
 	    done ; \
 	done || true
-	@echo Installing .java files ... ; \
-	d=$(@D)/antlr.tmp ; for java in $$d/*.java ; do \
-	    b=`basename $$java` ; \
-	    ( set -x ; cp $$java $$d/../$$b ) ; \
-	done
-	rm -rf $*.antlered
-	touch $*.antlered
+	@echo Installing generated files files ... ; \
+	( cd $*.tmp ; for f in *.java *.txt ; do \
+	    ( set -x ; cp $$f ../$$f ) ; \
+	done )
+	rm -rf $*.antlred
+	touch $*.antlred
 
 # Get things building on 64-bit-X-32-bit environment.  Mainly need to
 # remove any attempt to force the compile to 64-bit.
diff --git a/frysk-core/ChangeLog b/frysk-core/ChangeLog
index cd66969..efddbdf 100644
--- a/frysk-core/ChangeLog
+++ b/frysk-core/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-14  Andrew Cagney  <cagney@redhat.com>
+
+	* Makefile.am (ANTLR): Delete.
+
 2007-11-13  Jose Flavio Aguilar Paulino <jflavio@br.ibm.com>
 
 	* Makefile.am: Add libunwind-ppc32 to gcj linker dependencies. 
diff --git a/frysk-core/Makefile.am b/frysk-core/Makefile.am
index 59be031..0a68867 100644
--- a/frysk-core/Makefile.am
+++ b/frysk-core/Makefile.am
@@ -41,8 +41,6 @@
 include common/Makefile.rules
 include Makefile.gen
 
-ANTLR = $(JAVA) -classpath ../frysk-imports/antlr.jar antlr.Tool
-
 GEN_SOURCEPATH += ../frysk-sys/
 GEN_SOURCEPATH += $(top_srcdir)/../frysk-sys/
 GEN_CLASSPATH += ../frysk-imports/jline.jar
diff --git a/frysk-core/frysk/expr/CExprAnnotator.g b/frysk-core/frysk/expr/CExprAnnotator.g
deleted file mode 100644
index d217b77..0000000
--- a/frysk-core/frysk/expr/CExprAnnotator.g
+++ /dev/null
@@ -1,238 +0,0 @@
-// This file is part of the program FRYSK.
-//
-// Copyright 2007 Red Hat Inc.
-//
-// FRYSK is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// FRYSK is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with FRYSK; if not, write to the Free Software Foundation,
-// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-// 
-// In addition, as a special exception, Red Hat, Inc. gives You the
-// additional right to link the code of FRYSK with code not covered
-// under the GNU General Public License ("Non-GPL Code") and to
-// distribute linked combinations including the two, subject to the
-// limitations in this paragraph. Non-GPL Code permitted under this
-// exception must only link to the code of FRYSK through those well
-// defined interfaces identified in the file named EXCEPTION found in
-// the source code files (the "Approved Interfaces"). The files of
-// Non-GPL Code may instantiate templates or use macros or inline
-// functions from the Approved Interfaces without causing the
-// resulting work to be covered by the GNU General Public
-// License. Only Red Hat, Inc. may make changes or additions to the
-// list of Approved Interfaces. You must obey the GNU General Public
-// License in all respects for all of the FRYSK code and other code
-// used in conjunction with FRYSK except the Non-GPL Code covered by
-// this exception. If you modify this file, you may extend this
-// exception to your version of the file, but you are not obligated to
-// do so. If you do not wish to provide this exception without
-// modification, you must delete this exception statement from your
-// version and license this file solely under the GPL without
-// exception.
-
-
-header
-{
-// This file is part of the program FRYSK.
-//
-// Copyright 2007 Red Hat Inc.
-//
-// FRYSK is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// FRYSK is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-// 
-// You should have received a copy of the GNU General Public License
-// along with FRYSK; if not, write to the Free Software Foundation,
-// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-// 
-// In addition, as a special exception, Red Hat, Inc. gives You the
-// additional right to link the code of FRYSK with code not covered
-// under the GNU General Public License ("Non-GPL Code") and to
-// distribute linked combinations including the two, subject to the
-// limitations in this paragraph. Non-GPL Code permitted under this
-// exception must only link to the code of FRYSK through those well
-// defined interfaces identified in the file named EXCEPTION found in
-// the source code files (the "Approved Interfaces"). The files of
-// Non-GPL Code may instantiate templates or use macros or inline
-// functions from the Approved Interfaces without causing the
-// resulting work to be covered by the GNU General Public
-// License. Only Red Hat, Inc. may make changes or additions to the
-// list of Approved Interfaces. You must obey the GNU General Public
-// License in all respects for all of the FRYSK code and other code
-// used in conjunction with FRYSK except the Non-GPL Code covered by
-// this exception. If you modify this file, you may extend this
-// exception to your version of the file, but you are not obligated to
-// do so. If you do not wish to provide this exception without
-// modification, you must delete this exception statement from your
-// version and license this file solely under the GPL without
-// exception.
-    package frysk.expr;
-
-    import java.util.ArrayList;
-    import frysk.value.ArithmeticType;
-    import frysk.value.SignedType;
-    import frysk.value.UnsignedType;
-    import frysk.value.FloatingPointType;
-    import frysk.value.Value;
-    import frysk.value.Variable;
-    import frysk.expr.ExprSymTab;
-    import frysk.expr.ExprAST;
-    import inua.eio.ByteOrder;
-    import lib.dwfl.BaseTypes;
-}
-
-class CExprAnnotator extends TreeParser;
-
-options {
-//  make will convert the import vocab lines into dependencies
-    importVocab=CExprParser;
-//  importVocab=CExprEvaluatorParser;
-    buildAST=true;
-    ASTLabelType = "ExprAST";
-}
-
-{
-    ArrayList      refList;
-    private ExprSymTab exprSymTab;
-    public CExprAnnotator(ExprSymTab symTab) {
-            exprSymTab = symTab;
-    }
-}
-
-
-primitiveType
-    :   "boolean"
-    |   "char"
-    |   "byte"
-    |   "short"
-    |   "int"
-    |   "long"
-    |   "float"
-    |   "double"
-    ;
-
-identifier
-    :   ident:IDENT  {ident.getText();} ;
-
-expr
-    :   #(PLUS  expr expr)  {	
-        }
-    |   ( #(MINUS expr expr) )=> #(MINUS expr expr) {
-        }
-    |   #(MINUS expr ) {
-        }
-    |   ( #(STAR expr expr) )=> #(STAR  expr expr) {
-        }
-    |   #(MEMORY expr) {
-        }
-    |   #(DIVIDE  expr expr) {
-        }
-    |   #(MOD  expr expr) {
-        }
-    |   #(SHIFTLEFT  expr expr) {
-        }
-    |   #(SHIFTRIGHT  expr expr) {
-        }
-    |   #(LESSTHAN  expr expr) {
-        }
-    |   #(GREATERTHAN  expr expr) {
-        }
-    |   #(LESSTHANOREQUALTO  expr expr) {
-        }
-    |   #(GREATERTHANOREQUALTO  expr expr) {
-        }
-    |   #(NOTEQUAL  expr expr) {
-        }
-    |   #(EQUAL  expr expr) {
-        }
-    |   ( #(AMPERSAND expr expr) )=>#(AMPERSAND  expr expr) {
-        }
-    |   #(ADDRESS_OF expr ) {
-        }
-    |   #(BITWISEXOR  expr expr) {
-        }
-    |   #(BITWISEOR  expr expr) {
-        }
-    |   #(AND  expr expr) {
-        }
-    |   #(OR  expr expr) {
-        }
-    |   #(NOT  expr) {
-        }
-    |   #(TILDE expr) {
-        }
-    |   #(COND_EXPR  expr expr expr) {
-        }
-    |   o:OCTALINT  {
-        }
-    |   i:DECIMALINT  {
-        }
-    |   h:HEXADECIMALINT  {
-        }
-    |   f:FLOAT  {
-        }
-    |   d:DOUBLE  {
-        }
-    |   #(ASSIGNEQUAL expr expr)  {
-        }
-    |   #(TIMESEQUAL expr expr)  {
-        }
-    |   #(DIVIDEEQUAL expr expr)  {
-        }
-    |   #(MINUSEQUAL expr expr)  {
-        }
-    |   #(PLUSEQUAL expr expr)  {
-        }
-    |   #(MODEQUAL expr expr)  {
-        }
-    |   #(SHIFTLEFTEQUAL expr expr)  {
-        }
-    |   #(SHIFTRIGHTEQUAL expr expr)  {
-        }
-    |   #(BITWISEANDEQUAL expr expr)  {
-        }
-    |   #(BITWISEXOREQUAL expr expr)  {
-        }
-    |   #(BITWISEOREQUAL expr expr)  {
-        }
-    |   #(CAST pt:primitiveType expr) { 
-	    if(pt.getText().compareTo("long") == 0) {
-	      }
-	    else if(pt.getText().compareTo("int") == 0) {
-	      }
-	    else if(pt.getText().compareTo("short") == 0) {
-	      }
-	    else if(pt.getText().compareTo("double") == 0) {
-	      }
-	    else if(pt.getText().compareTo("float") == 0) {
-	      }
-        }
-    |   #(EXPR_LIST expr) {
-        }
-    |   #(FUNC_CALL expr expr) {
-        }
-    |   #(MEMBER expr identifier) {
-        }     
-    |   ident:IDENT  {
-            Variable var;
-            var = (Variable)exprSymTab.getVariable(ident.getText());
-            ident.exprType = exprSymTab.getType(var);
-        }
-    |   tident:TAB_IDENT  {
-            Variable var;
-            var = (Variable)exprSymTab.getVariable(tident.getText());
-            tident.exprType = exprSymTab.getType(var);
-        }
-    ;
diff --git a/frysk-core/frysk/expr/ChangeLog b/frysk-core/frysk/expr/ChangeLog
index f4519d1..2e0f515 100644
--- a/frysk-core/frysk/expr/ChangeLog
+++ b/frysk-core/frysk/expr/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-14  Andrew Cagney  <cagney@redhat.com>
+
+	* CExprAnnotator.g: Delete.
+
 2007-11-14  Teresa Thomas  <tthomas@redhat.com>
 	
 	* CExprEvaluator.g: Give task memory to 


hooks/post-receive
--
frysk system monitor/debugger



More information about the Frysk-cvs mailing list