add Environment#build_after

This commit is contained in:
josh committed 2017-05-25 17:00:21 -04:00
1 parent 68468b6422
commit 05bbea6fa1
4 files changed
+59

No files matched your search

@@ -0,0 +1,8 @@
Rscons::Environment.new do |env|
env.Command("inc.c",
[],
"CMD" => %w[ruby gen.rb ${_TARGET}],
"CMD_DESC" => "Generating")
env.build_after("program.o", "inc.c")
env.Program("program.exe", ["program.c", "inc.c"])
end
+9
View File
@@ -0,0 +1,9 @@
sleep 1.0
c_file = ARGV.first
h_file = File.basename(c_file, ".c") + ".h"
File.open(c_file, "w") do |fh|
fh.puts
end
File.open(h_file, "w") do |fh|
fh.puts("#define THE_VALUE 191")
end