vasm/vasm.rb
2026-07-29 16:42:54 +03:00

27 lines
787 B
Ruby

class Vasm < Formula
desc "Portable and retargetable assembler"
homepage "https://github.com/siemens-mobile-hacks/vasm"
url "https://github.com/siemens-mobile-hacks/vasm.git",
tag: "RELEASE_TAG_NAME",
revision: "RELEASE_TAG_HASH"
head "https://github.com/siemens-mobile-hacks/vasm.git", branch: "main"
def install
cpu_files = %w[cpu.c cpu.h]
cpus = Dir.children("cpus").select do |cpu|
cpu_files.all? { |file| File.file?("cpus/#{cpu}/#{file}") }
end.sort
syntaxes = %w[std madmac mot oldstyle]
cpus.product(syntaxes).each do |cpu, syntax|
system "make", "CPU=#{cpu}", "SYNTAX=#{syntax}"
bin.install "vasm#{cpu}_#{syntax}"
end
bin.install "vobjdump"
end
test do
system bin/"vasmarm_std", "-v"
end
end