summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/make/makefile.lua
diff options
context:
space:
mode:
authorAlexis Cheron <[email protected]>2021-07-12 16:44:59 +0400
committerAlexis Cheron <[email protected]>2021-07-12 16:44:59 +0400
commit2cf812f131ea771dd81117a815b1131d99009589 (patch)
treec5c4b1e1f36b18a23965f66819e768099059e120 /xmake/plugins/project/make/makefile.lua
parent4d62362c12ec2c3dbf387cbee561574c051d4bcf (diff)
makefile project: handle case where targetdir is .
Diffstat (limited to 'xmake/plugins/project/make/makefile.lua')
-rw-r--r--xmake/plugins/project/make/makefile.lua13
1 files 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