Skip to content

Commit

Permalink
Merge pull request #141 from riscv-software-src/rake_dep
Browse files Browse the repository at this point in the history
Make arch gen stamps dependent on object model
  • Loading branch information
dhower-qc authored Oct 18, 2024
2 parents 3b28c5b + 44b2ebe commit d4597d6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions backends/arch_gen/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,29 @@ file "#{$root}/.stamps/arch-gen.stamp" => (
FileUtils.touch(t.name)
end

obj_model_files = Dir.glob($root / "lib" / "arch_obj_models" / "*.rb")
obj_model_files << ($root / "lib" / "arch_def.rb")

arch_files = Dir.glob($root / "arch" / "**" / "*.yaml")

# stamp to indicate completion of Arch Gen for a given config
rule %r{#{$root}/\.stamps/arch-gen-.*\.stamp} => proc { |tname|
config_name = Pathname.new(tname).basename(".stamp").sub("arch-gen-", "")
arch_files = Dir.glob($root / "arch" / "**" / "*.yaml")
config_files =
Dir.glob($root / "cfgs" / config_name / "arch_overlay" / "**" / "*.yaml") +
[($root / "cfgs" / config_name / "params.yaml").to_s]
[
"#{$root}/.stamps",
"#{ARCH_GEN_DIR}/lib/arch_gen.rb",
"#{$root}/lib/idl/ast.rb",
"#{ARCH_GEN_DIR}/tasks.rake"
] + arch_files + config_files
"#{ARCH_GEN_DIR}/tasks.rake",
arch_files,
config_files,

# the stamp file is not actually dependent on the Ruby object model,
# but in general we want to rebuild anything using this stamp when the object model changes
obj_model_files.map(&:to_s)
].flatten
} do |t|
config_name = Pathname.new(t.name).basename(".stamp").sub("arch-gen-", "")

Expand Down

0 comments on commit d4597d6

Please sign in to comment.