So, I am studying rubyat the moment and discovered rake. I like to learn new tools, realizing what I already know with them, so I'm trying to convert Makefilewhat I have to rake.
Let's say it looks like this:
main: build/*.o
clang -c $^ -o $@
build/%.o: src/%.c | build
clang -c $< -o $@
build:
mkdir build
What is especially important in this Makefile:
- Match patterns with
% - Order only dependency with
| build
Is there a way to implement this logic with rakeor do I need to use ruby? For instance.
task :default => "main"
file "main" => "build/%.o" do
sh "clang -o 'main' ??"
end
file 'build/%.o' => "src/%.c" do
sh "clang -c ?? ??"
end
source
share