From 2cf812f131ea771dd81117a815b1131d99009589 Mon Sep 17 00:00:00 2001 From: Alexis Cheron Date: Mon, 12 Jul 2021 16:44:59 +0400 Subject: makefile project: handle case where targetdir is . --- xmake/plugins/project/make/makefile.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua index 75afafa92..6b94cf992 100644 --- a/xmake/plugins/project/make/makefile.lua +++ b/xmake/plugins/project/make/makefile.lua @@ -220,8 +220,17 @@ function _make_target(makefile, target, targetflags) -- make head local targetfile = target:targetfile() - makefile:print("%s: %s", target:name(), targetfile) - makefile:printf("%s:", targetfile) + local targetname = target:name() + + -- rules like `./target` and `target` are equivalent and can causes issues + -- for cases where targetdir is . + -- in these cases, the targetfile rule is not created + if targetfile == "./" .. targetname then + makefile:printf("%s:", targetname) + else + makefile:print("%s: %s", targetname, targetfile) + makefile:printf("%s:", targetfile) + end -- make dependence for the dependent targets for _, depname in ipairs(target:get("deps")) do -- cgit v1.3.1