Fix custom build when new files are in new/missing directory

This commit is contained in:
Jarod42 2022-09-06 20:23:21 +02:00
parent db19fa5acc
commit 660e4e2589
2 changed files with 13 additions and 1 deletions

View File

@ -401,7 +401,7 @@
buildmessage = "\t@{ECHO} " .. p.quote(config.buildmessage) .. "\n"
end
local commands = table.implode(config.buildcommands,"\t","\n","")
table.insert(makefilerules, os.translateCommandsAndPaths(outputs .. ": " .. filename .. inputs .. "\n" .. buildmessage .. commands, cfg.project.basedir, cfg.project.location))
table.insert(makefilerules, os.translateCommandsAndPaths(outputs .. ": " .. filename .. inputs .. "\n" .. buildmessage .. "\t@$(MakeDirCommand) $(@D)\n" .. commands, cfg.project.basedir, cfg.project.location))
table.insertflat(dependencies, outputs)
return true
end

View File

@ -112,10 +112,12 @@
<CustomPreBuild>test.obj test2.obj
test.obj: test.rule
@echo "Rule-ing test.rule"
@$(MakeDirCommand) $(@D)
dorule -p "test.rule"
test2.obj: test2.rule
@echo "Rule-ing test2.rule"
@$(MakeDirCommand) $(@D)
dorule -p -p2 "test2.rule"
</CustomPreBuild>
</AdditionalRules>
@ -157,18 +159,22 @@ test2.obj: test2.rule
<CustomPreBuild>test.obj test2.obj test3.obj test4.obj
test.obj: test.rule
@echo "Rule-ing test.rule"
@$(MakeDirCommand) $(@D)
dorule testValue1 testValue2 "test.rule"
test2.obj: test2.rule
@echo "Rule-ing test2.rule"
@$(MakeDirCommand) $(@D)
dorule -StestValue1 -StestValue2 "test2.rule"
test3.obj: test3.rule
@echo "Rule-ing test3.rule"
@$(MakeDirCommand) $(@D)
dorule testValue1,testValue2 "test3.rule"
test4.obj: test4.rule
@echo "Rule-ing test4.rule"
@$(MakeDirCommand) $(@D)
dorule -OtestValue1,testValue2 "test4.rule"
</CustomPreBuild>
</AdditionalRules>
@ -198,10 +204,12 @@ test4.obj: test4.rule
<CustomPreBuild>test.obj test2.obj
test.obj: test.rule
@echo "Rule-ing test.rule"
@$(MakeDirCommand) $(@D)
dorule S0 "test.rule"
test2.obj: test2.rule
@echo "Rule-ing test2.rule"
@$(MakeDirCommand) $(@D)
dorule S1 "test2.rule"
</CustomPreBuild>
</AdditionalRules>
@ -222,6 +230,7 @@ test2.obj: test2.rule
<CustomPreBuild>toto.c
toto.c: toto.txt extra_dependency
@echo "Some message"
@$(MakeDirCommand) $(@D)
test
test toto.c
</CustomPreBuild>
@ -242,6 +251,7 @@ toto.c: toto.txt extra_dependency
<CustomPreBuild>toto.c
toto.c: toto.txt extra_dependency
@echo "\"Some message\""
@$(MakeDirCommand) $(@D)
test
test toto.c
</CustomPreBuild>
@ -263,11 +273,13 @@ toto.c: toto.txt extra_dependency
<CustomPreBuild>bar.c foo.c
bar.c: bar.txt bar.h extra_dependency
@echo "Some message"
@$(MakeDirCommand) $(@D)
test
test bar
foo.c: foo.txt foo.h extra_dependency
@echo "Some message"
@$(MakeDirCommand) $(@D)
test
test foo
</CustomPreBuild>