Commit 296e7413 authored by Tristan Gingold's avatar Tristan Gingold

tools: factorize code.

parent 401120be
......@@ -168,7 +168,7 @@ fuse:
self.write(' -i ')
self.write(' '.join(vl_file.include_dirs))
self.writeln(" $<")
self._makefile_sim_file_touch_stamp()
self._makefile_touch_stamp_file()
self.writeln()
self.write("\n")
# list rules for all _primary.dat files for vhdl
......@@ -186,8 +186,7 @@ fuse:
lib, purename, "." + purename) + '\n')
self.writeln("\t\tvhpcomp $(VHPCOMP_FLAGS) -work {lib}=.{slash}{lib} $< ".format(
lib=lib, slash=shell.makefile_slash_char()))
self.writeln("\t\t@" + shell.mkdir_command() +
" $(dir $@) && " + shell.touch_command() + " $@\n")
self._makefile_touch_stamp_file()
self.writeln()
# dependency meta-target.
# This rule just list the dependencies of the above file
......@@ -201,5 +200,4 @@ fuse:
for dep_file in vhdl_file.depends_on:
self.write(" \\\n" + self.get_stamp_file(dep_file))
self.write('\n')
self.writeln("\t\t@" + shell.mkdir_command() +
" $(dir $@) && " + shell.touch_command() + " $@\n")
self._makefile_touch_stamp_file()
......@@ -103,7 +103,7 @@ class ToolMakefile(object):
name = dep_file.purename
return os.path.join(dep_file.library, name, ".{}_{}".format(name, dep_file.extension()))
def _makefile_sim_file_touch_stamp(self):
def _makefile_touch_stamp_file(self):
self.write("\t\t@" + shell.mkdir_command() + " $(dir $@)")
self.writeln(" && " + shell.touch_command() + " $@\n")
......
......@@ -110,7 +110,7 @@ TOP_MODULE := {top_module}
elif isinstance(file_aux, VerilogFile):
command_key = 'vlog'
self.writeln("\t\t" + self.SIMULATOR_CONTROLS[command_key].format(work=file_aux.library))
self._makefile_sim_file_touch_stamp()
self._makefile_touch_stamp_file()
self.writeln()
def _makefile_sim_command(self):
......
......@@ -121,11 +121,11 @@ class MakefileVsim(MakefileSim):
self._makefile_sim_file_rule(vlog)
self.writeln("\t\tvlog -work {library} $(VLOG_FLAGS) {sv_option} $(INCLUDE_DIRS) $<".format(
library=vlog.library, sv_option="-sv" if isinstance(vlog, SVFile) else ""))
self._makefile_sim_file_touch_stamp()
self._makefile_touch_stamp_file()
self.writeln()
# list rules for all _primary.dat files for vhdl
for vhdl in fileset.filter(VHDLFile).sort():
self._makefile_sim_file_rule(vhdl)
self.writeln("\t\tvcom $(VCOM_FLAGS) -work {} $< ".format(vhdl.library))
self._makefile_sim_file_touch_stamp()
self._makefile_touch_stamp_file()
self.writeln()
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