Commit 5582e2ab authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Index: ChangeLog

from  Benoît Perrot  <benoit@lrde.epita.fr>

	Participate to "builddir != srcdir" compilation.

	* dev/inst-builder-gen.py,
	* dev/inst-nodes-gen.py,
	* dev/inst-solver-gen.py,
	* dev/doc-inst-set-gen.py,
	* dev/parse-asm-scan-gen.py,
	* dev/parse-asm-parse-gen.py:
	Ask for a directory where the files have to be generated.
	* src/parse/Makefile.am,
	* src/inst/Makefile.am,
	* doc/Makefile.am:
	Specify the directory where to generate.
parent 40ac9a5e
2004-10-25 Benot Perrot <benoit@lrde.epita.fr>
Participate to "builddir != srcdir" compilation.
* dev/inst-builder-gen.py,
* dev/inst-nodes-gen.py,
* dev/inst-solver-gen.py,
* dev/doc-inst-set-gen.py,
* dev/parse-asm-scan-gen.py,
* dev/parse-asm-parse-gen.py:
Ask for a directory where the files have to be generated.
* src/parse/Makefile.am,
* src/inst/Makefile.am,
* doc/Makefile.am:
Specify the directory where to generate.
2004-10-04 Benot Perrot <benoit@lrde.epita.fr>
Use a dedicated script to launch bison to control the directory
......
......@@ -25,6 +25,11 @@ import nolimips
#### Nolimips' instruction set texi generator --------------
if __name__ != "__main__" or len(sys.argv) != 2:
print "Usage: .. SRCDIR"
sys.exit(1)
srcdir = sys.argv[1]
parser = nolimips.InstructionSetParser()
instructions = parser.parse(sys.stdin)
......@@ -62,5 +67,5 @@ for inst in instructions:
## Epilogue
sys.stdout.close()
sys.stdout = sys.__stdout__
nolimips.lazy_overwrite("inst-set.texi", "inst-set.texi.tmp")
nolimips.lazy_overwrite(srcdir + os.sep + "inst-set.texi", "inst-set.texi.tmp")
os.remove("inst-set.texi.tmp")
......@@ -26,6 +26,11 @@ from nolimips import license, depth, class_id
#### Nolimips' program builder generator -------------------
if __name__ != "__main__" or len(sys.argv) != 2:
print "Usage: .. SRCDIR"
sys.exit(1)
srcdir = sys.argv[1]
parser = nolimips.InstructionSetParser()
instructions = parser.parse(sys.stdin)
......@@ -184,5 +189,6 @@ print """
## Epilogue
sys.stdout.close()
sys.stdout = sys.__stdout__
nolimips.lazy_overwrite("program_builder.hh", "program_builder.hh.tmp")
nolimips.lazy_overwrite(srcdir + os.sep + "program_builder.hh",
"program_builder.hh.tmp")
os.remove("program_builder.hh.tmp")
......@@ -25,6 +25,11 @@ import nolimips
#### Nolimips' instruction classes generator ---------------
if __name__ != "__main__" or len(sys.argv) != 2:
print "Usage: .. SRCDIR"
sys.exit(1)
srcdir = sys.argv[1]
## Generate the class corresponding to an instruction
def class_generate(inst):
......@@ -229,7 +234,8 @@ def class_generate(inst):
# Check differences between old and new files
sys.stdout = sys.__stdout__
f.close()
nolimips.lazy_overwrite(file_id + "." + ext, file_id + "." + ext + ".tmp")
nolimips.lazy_overwrite(srcdir + os.sep + file_id + "." + ext,
file_id + "." + ext + ".tmp")
os.remove(file_id + "." + ext + ".tmp")
## Main --------------------------------
......@@ -252,7 +258,7 @@ for inst in instructions:
print "#endif // !INST_ALL_HH"
sys.stdout.close()
sys.stdout = sys.__stdout__
nolimips.lazy_overwrite("all.hh", "all.hh.tmp")
nolimips.lazy_overwrite(srcdir + os.sep + "all.hh", "all.hh.tmp")
os.remove("all.hh.tmp")
## Generate all-declarator
......@@ -274,7 +280,7 @@ print """
"""
sys.stdout.close()
sys.stdout = sys.__stdout__
nolimips.lazy_overwrite("decl.hh", "decl.hh.tmp")
nolimips.lazy_overwrite(srcdir + os.sep + "decl.hh", "decl.hh.tmp")
os.remove("decl.hh.tmp")
## Generate visitor
......@@ -315,5 +321,5 @@ print """
#endif // !INST_VISITOR_HH"""
sys.stdout.close()
sys.stdout = sys.__stdout__
nolimips.lazy_overwrite("visitor.hh", "visitor.hh.tmp")
nolimips.lazy_overwrite(srcdir + os.sep + "visitor.hh", "visitor.hh.tmp")
os.remove("visitor.hh.tmp")
......@@ -26,6 +26,11 @@ from nolimips import license, depth, class_id
#### Nolimips' program solver generator --------------------
if __name__ != "__main__" or len(sys.argv) != 2:
print "Usage: .. SRCDIR"
sys.exit(1)
srcdir = sys.argv[1]
parser = nolimips.InstructionSetParser()
instructions = parser.parse(sys.stdin)
......@@ -124,7 +129,8 @@ print """
sys.stdout.close()
sys.stdout = sys.__stdout__
nolimips.lazy_overwrite("program_solver.hh", "program_solver.hh.tmp")
nolimips.lazy_overwrite(srcdir + os.sep + "program_solver.hh",
"program_solver.hh.tmp")
os.remove("program_solver.hh.tmp")
......@@ -262,5 +268,6 @@ print """
sys.stdout.close()
sys.stdout = sys.__stdout__
nolimips.lazy_overwrite("program_solver.cc", "program_solver.cc.tmp")
nolimips.lazy_overwrite(srcdir + os.sep + "program_solver.cc",
"program_solver.cc.tmp")
os.remove("program_solver.cc.tmp")
......@@ -26,6 +26,11 @@ from nolimips import license, depth, define_id
#### Nolimips' Bison assembly parser generator -------------
if __name__ != "__main__" or len(sys.argv) != 2:
print "Usage: .. SRCDIR"
sys.exit(1)
srcdir = sys.argv[1]
parser = nolimips.InstructionSetParser()
instructions = parser.parse(sys.stdin)
......@@ -298,5 +303,5 @@ namespace yy
sys.stdout.close()
sys.stdout = sys.__stdout__
nolimips.lazy_overwrite("asm-parse.yy", "asm-parse.yy.tmp")
nolimips.lazy_overwrite(srcdir + os.sep + "asm-parse.yy", "asm-parse.yy.tmp")
os.remove("asm-parse.yy.tmp")
......@@ -26,6 +26,11 @@ from nolimips import license, define_id
#### Nolimips' Flex scanner generator --------------------------
if __name__ != "__main__" or len(sys.argv) != 2:
print "Usage: .. SRCDIR"
sys.exit(1)
srcdir = sys.argv[1]
parser = nolimips.InstructionSetParser()
instructions = parser.parse(sys.stdin)
......@@ -280,5 +285,5 @@ namespace parse
sys.stdout.close()
sys.stdout = sys.__stdout__
nolimips.lazy_overwrite("asm-scan.ll", "asm-scan.ll.tmp")
nolimips.lazy_overwrite(srcdir + os.sep + "asm-scan.ll", "asm-scan.ll.tmp")
os.remove("asm-scan.ll.tmp")
......@@ -9,7 +9,7 @@ BUILT_SOURCES = \
$(FROM_DOC_INST_SET_GEN_PY) doc-inst-set-gen.log
doc-inst-set-gen.log: $(top_srcdir)/dev/doc-inst-set-gen.py $(top_srcdir)/dev/nolimips.xml
$(top_srcdir)/dev/doc-inst-set-gen.py < $(top_srcdir)/dev/nolimips.xml
$(top_srcdir)/dev/doc-inst-set-gen.py . < $(top_srcdir)/dev/nolimips.xml
touch $@
$(FROM_DOC_INST_SET_GEN_PY): doc-inst-set-gen.log
......
......@@ -10,28 +10,28 @@ BUILT_SOURCES = \
# This code comes from "Handling Tools that Produce Many Outputs",
# from the Automake documentation.
nodes.mk: $(top_srcdir)/dev/inst-nodes-mk-gen.py $(top_srcdir)/dev/nolimips.xml
$(srcdir)/nodes.mk: $(top_srcdir)/dev/inst-nodes-mk-gen.py $(top_srcdir)/dev/nolimips.xml
$(top_srcdir)/dev/inst-nodes-mk-gen.py < $(top_srcdir)/dev/nolimips.xml >$@.tmp
mv -f $@.tmp $@
inst-nodes-gen.stamp: $(top_srcdir)/dev/inst-nodes-gen.py $(top_srcdir)/dev/nolimips.xml
$(srcdir)/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
$(top_srcdir)/dev/inst-nodes-gen.py $(srcdir) < $(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
$(srcdir)/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
$(top_srcdir)/dev/inst-builder-gen.py $(srcdir) < $(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
$(srcdir)/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
$(top_srcdir)/dev/inst-solver-gen.py $(srcdir) < $(top_srcdir)/dev/nolimips.xml
@mv -f $@.tmp $@
program_solver.hh program_solver.cc: inst-solver-gen.stamp
......
......@@ -4,9 +4,9 @@ INCLUDES = -I $(top_srcdir)/src -I $(top_builddir)/src
# "[asm-parse.cc] is not part of [FROM_ASM_PARSE_YY] to prevent
# [asm-parse.cc] from occuring twice in libparse_a_SOURCES to avoid
# double inclusion of [asm-parse.o]."
FROM_ASM_PARSE_YY = \
stack.hh position.hh location.hh \
asm-parse.hh
FROM_ASM_PARSE_YY = \
$(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh \
$(srcdir)/asm-parse.hh
BUILT_SOURCES = \
asm-scan.ll parse-asm-scan.stamp \
......@@ -16,19 +16,19 @@ BUILT_SOURCES = \
# This code comes from "Handling Tools that Produce Many Outputs",
# from the Automake documentation.
parse-asm-scan.stamp: $(top_srcdir)/dev/parse-asm-scan-gen.py $(top_srcdir)/dev/nolimips.xml
$(srcdir)/parse-asm-scan.stamp: $(top_srcdir)/dev/parse-asm-scan-gen.py $(top_srcdir)/dev/nolimips.xml
@rm -rf $@.tmp
@touch $@.tmp
$(top_srcdir)/dev/parse-asm-scan-gen.py < $(top_srcdir)/dev/nolimips.xml
$(top_srcdir)/dev/parse-asm-scan-gen.py $(srcdir) < $(top_srcdir)/dev/nolimips.xml
@mv -f $@.tmp $@
asm-scan.ll: parse-asm-scan.stamp
$(srcdir)/asm-scan.ll: $(srcdir)/parse-asm-scan.stamp
parse-asm-parse.stamp: $(top_srcdir)/dev/parse-asm-parse-gen.py $(top_srcdir)/dev/nolimips.xml
$(srcdir)/parse-asm-parse.stamp: $(top_srcdir)/dev/parse-asm-parse-gen.py $(top_srcdir)/dev/nolimips.xml
@rm -rf $@.tmp
@touch $@.tmp
$(top_srcdir)/dev/parse-asm-parse-gen.py < $(top_srcdir)/dev/nolimips.xml
$(top_srcdir)/dev/parse-asm-parse-gen.py $(srcdir) < $(top_srcdir)/dev/nolimips.xml
@mv -f $@.tmp $@
asm-parse.yy: parse-asm-parse.stamp
$(srcdir)/asm-parse.yy: $(srcdir)/parse-asm-parse.stamp
BISONXX = $(top_srcdir)/config/bison++
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment