diff options
| author | Alexis Cheron <[email protected]> | 2021-07-12 16:44:59 +0400 |
|---|---|---|
| committer | Alexis Cheron <[email protected]> | 2021-07-12 16:44:59 +0400 |
| commit | 2cf812f131ea771dd81117a815b1131d99009589 (patch) | |
| tree | c5c4b1e1f36b18a23965f66819e768099059e120 /xmake/plugins/project/make/makefile.lua | |
| parent | 4d62362c12ec2c3dbf387cbee561574c051d4bcf (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.lua | 13 |
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 |
