summaryrefslogtreecommitdiff
path: root/xmake/scripts/platform
diff options
context:
space:
mode:
authorruki <[email protected]>2015-05-19 15:35:49 +0800
committerruki <[email protected]>2015-05-19 15:35:49 +0800
commit75bdd1517bc093774855c23a286e97113896f5f0 (patch)
tree4dd3eded914ea143c39fb05480babc5b603123da /xmake/scripts/platform
parentf9214c5e20b64d662af20b83da5889e6675dea95 (diff)
make object deps for makefile
Diffstat (limited to 'xmake/scripts/platform')
-rw-r--r--xmake/scripts/platform/_macosx.lua21
-rw-r--r--xmake/scripts/platform/platform.lua20
2 files changed, 18 insertions, 23 deletions
diff --git a/xmake/scripts/platform/_macosx.lua b/xmake/scripts/platform/_macosx.lua
index 428d2ae02..3a3879730 100644
--- a/xmake/scripts/platform/_macosx.lua
+++ b/xmake/scripts/platform/_macosx.lua
@@ -24,23 +24,16 @@
local _macosx = _macosx or {}
-- init _macosx
-function _macosx.init()
+function _macosx.init(configs)
- -- init configs
- local configs = {}
-
- -- init the target file suffix name
- configs.suffix = {}
- configs.suffix.static = ".a"
- configs.suffix.object = ".o"
- configs.suffix.shared = ".dylib"
-
- -- init the target file prefix name
- configs.prefix = {}
- configs.prefix.static = "lib"
+ -- init the file name format
+ configs.format = {}
+ configs.format.static = {"lib", ".a"}
+ configs.format.object = {"", ".o"}
+ configs.format.shared = {"", ".dylib"}
-- ok
- return configs
+ return true
end
diff --git a/xmake/scripts/platform/platform.lua b/xmake/scripts/platform/platform.lua
index 47ccb4914..6ee8de802 100644
--- a/xmake/scripts/platform/platform.lua
+++ b/xmake/scripts/platform/platform.lua
@@ -30,26 +30,28 @@ local config = require("base/config")
-- init platform
function platform.init()
- -- have been existed?
- if platform._CONFIGS then
- return platform._CONFIGS
- end
+ -- init platform configs
+ platform._CONFIGS = platform._CONFIGS or {}
+ local configs = platform._CONFIGS
-- get target
local target = config.target()
assert(target)
+ -- init configs
+ configs.plat = target.plat
+ configs.host = target.host
+ configs.arch = target.arch
+ configs.mode = target.mode
+
-- load platform
local p = require("platform/_" .. target.plat)
if not p then
- return nil
+ return false
end
-- init platform
- platform._CONFIGS = p.init()
-
- -- ok?
- return platform._CONFIGS
+ return p.init(configs)
end
-- dump configs