
Index: ChangeLog from BenoƮt Perrot <benoit@lrde.epita.fr> * dev/inst-makefile-gen.py: Move to... * dev/inst-nodes-mk-gen.py: This file. * Makefile.am, boostrap: Propagate. Index: Makefile.am --- Makefile.am (revision 132) +++ Makefile.am (revision 133) @@ -8,7 +8,7 @@ dev/nolimips.py \ dev/parse-asm-scan-gen.py \ dev/parse-asm-parse-gen.py \ - dev/inst-makefile-gen.py \ + dev/inst-nodes-mk-gen.py \ dev/inst-nodes-gen.py \ dev/inst-builder-gen.py \ dev/inst-solver-gen.py \ Index: bootstrap --- bootstrap (revision 132) +++ bootstrap (revision 133) @@ -1,4 +1,4 @@ #!/bin/sh -cd src/inst && ../../dev/inst-makefile-gen.py < ../../dev/nolimips.xml && cd - +cd src/inst && ../../dev/inst-nodes-mk-gen.py < ../../dev/nolimips.xml && cd - autoreconf -f -v -i -m Index: dev/inst-nodes-mk-gen.py --- dev/inst-nodes-mk-gen.py (revision 0) +++ dev/inst-nodes-mk-gen.py (revision 133) @@ -0,0 +1,104 @@ +#!/usr/bin/env python +## +## This file is part of Nolimips, a MIPS simulator with unlimited registers +## Copyright (C) 2003, 2004 Benoit Perrot <benoit@lrde.epita.fr> +## +## Nolimips 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; either version 2 of the License, or +## (at your option) any later version. +## +## Nolimips 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 this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## + +import sys, os +import string, re + +import nolimips +from nolimips import license, depth + +#### Nolimips' inst/Makefile.am generator ------------------ + +parser = nolimips.InstructionSetParser() +instructions = parser.parse(sys.stdin) + +sys.stdout = file("Makefile.am.tmp", "w") + +print """INCLUDES = -I $(top_srcdir)/src -I $(top_builddir)/src + +FROM_INST_NODES_GEN_PY = \\""" +for i in range(0, len(instructions)): + if instructions[i].level == "native": + line = "\t" + for ext in ["hh", "hxx", "cc"]: + line = line + instructions[i].opcode + "." + ext + " " + print line + "\t\t\\" +print """ decl.hh \\ + all.hh \\ + visitor.hh""" + +print """ +BUILT_SOURCES = \\ + $(FROM_INST_NODES_GEN_PY) inst-nodes-gen.stamp \\ + program_builder.hh inst-builder-gen.stamp \\ + program_solver.hh program_solver.cc inst-solver-gen.stamp + +# This code comes from \"Handling Tools that Produce Many Outputs\", +# from the Automake documentation. + +inst-nodes-gen.stamp: $(top_srcdir)/dev/inst-nodes-gen.py $(top_srcdir)/dev/nolimips.xml + @rm -rf $@.tmp + @touch $@.tmp + $(top_srcdir)/dev/inst-nodes-gen.py < $(top_srcdir)/dev/nolimips.xml + @mv -f $@.tmp $@ +$(FROM_INST_NODES_GEN_PY): inst-nodes-gen.stamp + +inst-builder-gen.stamp: $(top_srcdir)/dev/inst-builder-gen.py $(top_srcdir)/dev/nolimips.xml + @rm -rf $@.tmp + @touch $@.tmp + $(top_srcdir)/dev/inst-builder-gen.py < $(top_srcdir)/dev/nolimips.xml + @mv -f $@.tmp $@ +program_builder.hh: inst-builder-gen.stamp + +inst-solver-gen.stamp: $(top_srcdir)/dev/inst-solver-gen.py $(top_srcdir)/dev/nolimips.xml + @rm -rf $@.tmp + @touch $@.tmp + $(top_srcdir)/dev/inst-solver-gen.py < $(top_srcdir)/dev/nolimips.xml + @mv -f $@.tmp $@ +program_solver.hh program_solver.cc: inst-solver-gen.stamp + + +MAINTAINERCLEANFILES = \\ + $(FROM_INST_NODES_GEN_PY) \\ + program_builder.hh \\ + program_solver.hh program_solver.cc + +noinst_LIBRARIES = libinst.a +libinst_a_SOURCES = \\ + $(FROM_INST_NODES_GEN_PY) inst-nodes-gen.stamp \\ + register.hh \\ + exp.hh exp.cc \\ + exp-visitor.hh \\ + inst.hh \\ + program.hh \\ + label.hh label.cc \\ + section.hh \\ + text_section.hh text_section.cc \\ + data_section.hh data_section.cc \\ + program.hh \\ + program_builder.hh program_builder.cc inst-builder-gen.stamp \\ + program_solver.hh program_solver.cc inst-solver-gen.stamp \\ + inst-tasks.hh inst-tasks.cc""" + +## Epilogue +sys.stdout.close() +sys.stdout = sys.__stdout__ +nolimips.lazy_overwrite("Makefile.am", "Makefile.am.tmp") +os.remove("Makefile.am.tmp") Property changes on: dev/inst-nodes-mk-gen.py ___________________________________________________________________ Name: svn:executable + * Index: dev/inst-makefile-gen.py --- dev/inst-makefile-gen.py (revision 132) +++ dev/inst-makefile-gen.py (revision 133) @@ -1,104 +0,0 @@ -#!/usr/bin/env python -## -## This file is part of Nolimips, a MIPS simulator with unlimited registers -## Copyright (C) 2003, 2004 Benoit Perrot <benoit@lrde.epita.fr> -## -## Nolimips 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; either version 2 of the License, or -## (at your option) any later version. -## -## Nolimips 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 this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -## - -import sys, os -import string, re - -import nolimips -from nolimips import license, depth - -#### Nolimips' inst/Makefile.am generator ------------------ - -parser = nolimips.InstructionSetParser() -instructions = parser.parse(sys.stdin) - -sys.stdout = file("Makefile.am.tmp", "w") - -print """INCLUDES = -I $(top_srcdir)/src -I $(top_builddir)/src - -FROM_INST_NODES_GEN_PY = \\""" -for i in range(0, len(instructions)): - if instructions[i].level == "native": - line = "\t" - for ext in ["hh", "hxx", "cc"]: - line = line + instructions[i].opcode + "." + ext + " " - print line + "\t\t\\" -print """ decl.hh \\ - all.hh \\ - visitor.hh""" - -print """ -BUILT_SOURCES = \\ - $(FROM_INST_NODES_GEN_PY) inst-nodes-gen.stamp \\ - program_builder.hh inst-builder-gen.stamp \\ - program_solver.hh program_solver.cc inst-solver-gen.stamp - -# This code comes from \"Handling Tools that Produce Many Outputs\", -# from the Automake documentation. - -inst-nodes-gen.stamp: $(top_srcdir)/dev/inst-nodes-gen.py $(top_srcdir)/dev/nolimips.xml - @rm -rf $@.tmp - @touch $@.tmp - $(top_srcdir)/dev/inst-nodes-gen.py < $(top_srcdir)/dev/nolimips.xml - @mv -f $@.tmp $@ -$(FROM_INST_NODES_GEN_PY): inst-nodes-gen.stamp - -inst-builder-gen.stamp: $(top_srcdir)/dev/inst-builder-gen.py $(top_srcdir)/dev/nolimips.xml - @rm -rf $@.tmp - @touch $@.tmp - $(top_srcdir)/dev/inst-builder-gen.py < $(top_srcdir)/dev/nolimips.xml - @mv -f $@.tmp $@ -program_builder.hh: inst-builder-gen.stamp - -inst-solver-gen.stamp: $(top_srcdir)/dev/inst-solver-gen.py $(top_srcdir)/dev/nolimips.xml - @rm -rf $@.tmp - @touch $@.tmp - $(top_srcdir)/dev/inst-solver-gen.py < $(top_srcdir)/dev/nolimips.xml - @mv -f $@.tmp $@ -program_solver.hh program_solver.cc: inst-solver-gen.stamp - - -MAINTAINERCLEANFILES = \\ - $(FROM_INST_NODES_GEN_PY) \\ - program_builder.hh \\ - program_solver.hh program_solver.cc - -noinst_LIBRARIES = libinst.a -libinst_a_SOURCES = \\ - $(FROM_INST_NODES_GEN_PY) inst-nodes-gen.stamp \\ - register.hh \\ - exp.hh exp.cc \\ - exp-visitor.hh \\ - inst.hh \\ - program.hh \\ - label.hh label.cc \\ - section.hh \\ - text_section.hh text_section.cc \\ - data_section.hh data_section.cc \\ - program.hh \\ - program_builder.hh program_builder.cc inst-builder-gen.stamp \\ - program_solver.hh program_solver.cc inst-solver-gen.stamp \\ - inst-tasks.hh inst-tasks.cc""" - -## Epilogue -sys.stdout.close() -sys.stdout = sys.__stdout__ -nolimips.lazy_overwrite("Makefile.am", "Makefile.am.tmp") -os.remove("Makefile.am.tmp")