Skip to content

Commit d4597d6

Browse files
authored
Merge pull request #141 from riscv-software-src/rake_dep
Make arch gen stamps dependent on object model
2 parents 3b28c5b + 44b2ebe commit d4597d6

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

backends/arch_gen/tasks.rake

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,29 @@ file "#{$root}/.stamps/arch-gen.stamp" => (
125125
FileUtils.touch(t.name)
126126
end
127127

128+
obj_model_files = Dir.glob($root / "lib" / "arch_obj_models" / "*.rb")
129+
obj_model_files << ($root / "lib" / "arch_def.rb")
130+
131+
arch_files = Dir.glob($root / "arch" / "**" / "*.yaml")
132+
128133
# stamp to indicate completion of Arch Gen for a given config
129134
rule %r{#{$root}/\.stamps/arch-gen-.*\.stamp} => proc { |tname|
130135
config_name = Pathname.new(tname).basename(".stamp").sub("arch-gen-", "")
131-
arch_files = Dir.glob($root / "arch" / "**" / "*.yaml")
132136
config_files =
133137
Dir.glob($root / "cfgs" / config_name / "arch_overlay" / "**" / "*.yaml") +
134138
[($root / "cfgs" / config_name / "params.yaml").to_s]
135139
[
136140
"#{$root}/.stamps",
137141
"#{ARCH_GEN_DIR}/lib/arch_gen.rb",
138142
"#{$root}/lib/idl/ast.rb",
139-
"#{ARCH_GEN_DIR}/tasks.rake"
140-
] + arch_files + config_files
143+
"#{ARCH_GEN_DIR}/tasks.rake",
144+
arch_files,
145+
config_files,
146+
147+
# the stamp file is not actually dependent on the Ruby object model,
148+
# but in general we want to rebuild anything using this stamp when the object model changes
149+
obj_model_files.map(&:to_s)
150+
].flatten
141151
} do |t|
142152
config_name = Pathname.new(t.name).basename(".stamp").sub("arch-gen-", "")
143153

0 commit comments

Comments
 (0)