summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/makefile/makefile.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/plugins/project/makefile/makefile.lua')
-rw-r--r--xmake/plugins/project/makefile/makefile.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/xmake/plugins/project/makefile/makefile.lua b/xmake/plugins/project/makefile/makefile.lua
index 202dfa63a..860c67bd7 100644
--- a/xmake/plugins/project/makefile/makefile.lua
+++ b/xmake/plugins/project/makefile/makefile.lua
@@ -349,15 +349,20 @@ function _make_all(makefile)
makefile:print("")
-- make all
- local all = ""
+ local default = ""
for targetname, target in pairs(project.targets()) do
- local default = target:get("default")
- if default == nil or default == true then
- all = all .. " " .. targetname
+ local isdefault = target:get("default")
+ if isdefault == nil or isdefault == true then
+ default = default .. " " .. targetname
end
end
+ makefile:print("default: %s\n", default)
+ local all = ""
+ for targetname, _ in pairs(project.targets()) do
+ all = all .. " " .. targetname
+ end
makefile:print("all: %s\n", all)
- makefile:print(".PHONY: all %s\n", all)
+ makefile:print(".PHONY: default all %s\n", all)
-- make it for all targets
for _, target in pairs(project.targets()) do