summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-01-14 11:52:48 +0800
committerruki <[email protected]>2016-01-14 11:52:48 +0800
commit68a341347319f58cfb20fc6c4c4c0feed9b01252 (patch)
treebf3a5350d963c8c785b5e4c771f84753d2ec81cc
parentcdcf953259aee5e7e1a06855ddbedbaabf585bc9 (diff)
move platform directory
-rw-r--r--xmake/core/action/_clean.lua2
-rw-r--r--xmake/core/action/_config.lua2
-rw-r--r--xmake/core/action/_debug.lua2
-rw-r--r--xmake/core/action/_global.lua2
-rw-r--r--xmake/core/action/_install.lua2
-rw-r--r--xmake/core/action/_lua.lua2
-rw-r--r--xmake/core/action/_man.lua2
-rw-r--r--xmake/core/action/_package.lua2
-rw-r--r--xmake/core/action/_run.lua2
-rw-r--r--xmake/core/action/_uninstall.lua2
-rw-r--r--xmake/core/action/action.lua2
-rw-r--r--xmake/core/base/compiler.lua2
-rw-r--r--xmake/core/base/install.lua2
-rw-r--r--xmake/core/base/linker.lua2
-rw-r--r--xmake/core/base/makefile.lua2
-rw-r--r--xmake/core/base/package.lua2
-rw-r--r--xmake/core/base/path.lua23
-rw-r--r--xmake/core/base/platform.lua (renamed from xmake/core/platform/platform.lua)76
-rw-r--r--xmake/core/base/project.lua2
-rw-r--r--xmake/core/base/rule.lua2
-rw-r--r--xmake/core/base/uninstall.lua2
-rw-r--r--xmake/core/tools/gcc.lua2
-rw-r--r--xmake/core/tools/swiftc.lua2
-rw-r--r--xmake/core/tools/tools.lua2
-rw-r--r--xmake/platforms/android/android.lua (renamed from xmake/core/platform/android/android.lua)0
-rw-r--r--xmake/platforms/android/prober.lua (renamed from xmake/core/platform/android/prober.lua)0
-rw-r--r--xmake/platforms/iphoneos/iphoneos.lua (renamed from xmake/core/platform/iphoneos/iphoneos.lua)0
-rw-r--r--xmake/platforms/iphoneos/package.lua (renamed from xmake/core/platform/iphoneos/package.lua)2
-rw-r--r--xmake/platforms/iphoneos/prober.lua (renamed from xmake/core/platform/iphoneos/prober.lua)0
-rw-r--r--xmake/platforms/iphonesimulator/iphonesimulator.lua (renamed from xmake/core/platform/iphonesimulator/iphonesimulator.lua)0
-rw-r--r--xmake/platforms/iphonesimulator/prober.lua (renamed from xmake/core/platform/iphonesimulator/prober.lua)0
-rw-r--r--xmake/platforms/linux/install.lua (renamed from xmake/core/platform/linux/install.lua)2
-rw-r--r--xmake/platforms/linux/linux.lua (renamed from xmake/core/platform/linux/linux.lua)0
-rw-r--r--xmake/platforms/linux/prober.lua (renamed from xmake/core/platform/linux/prober.lua)0
-rw-r--r--xmake/platforms/linux/uninstall.lua (renamed from xmake/core/platform/macosx/uninstall.lua)2
-rw-r--r--xmake/platforms/macosx/install.lua (renamed from xmake/core/platform/macosx/install.lua)2
-rw-r--r--xmake/platforms/macosx/macosx.lua (renamed from xmake/core/platform/macosx/macosx.lua)0
-rw-r--r--xmake/platforms/macosx/prober.lua (renamed from xmake/core/platform/macosx/prober.lua)0
-rw-r--r--xmake/platforms/macosx/uninstall.lua (renamed from xmake/core/platform/linux/uninstall.lua)2
-rw-r--r--xmake/platforms/mingw/mingw.lua (renamed from xmake/core/platform/mingw/mingw.lua)0
-rw-r--r--xmake/platforms/mingw/prober.lua (renamed from xmake/core/platform/mingw/prober.lua)0
-rw-r--r--xmake/platforms/watchos/package.lua (renamed from xmake/core/platform/watchos/package.lua)2
-rw-r--r--xmake/platforms/watchos/prober.lua (renamed from xmake/core/platform/watchos/prober.lua)0
-rw-r--r--xmake/platforms/watchos/watchos.lua (renamed from xmake/core/platform/watchos/watchos.lua)0
-rw-r--r--xmake/platforms/watchsimulator/prober.lua (renamed from xmake/core/platform/watchsimulator/prober.lua)0
-rw-r--r--xmake/platforms/watchsimulator/watchsimulator.lua (renamed from xmake/core/platform/watchsimulator/watchsimulator.lua)0
-rw-r--r--xmake/platforms/windows/prober.lua (renamed from xmake/core/platform/windows/prober.lua)2
-rw-r--r--xmake/platforms/windows/tools/cl.lua (renamed from xmake/core/platform/windows/tools/cl.lua)2
-rw-r--r--xmake/platforms/windows/tools/lib.lua (renamed from xmake/core/platform/windows/tools/lib.lua)2
-rw-r--r--xmake/platforms/windows/tools/link.lua (renamed from xmake/core/platform/windows/tools/link.lua)2
-rw-r--r--xmake/platforms/windows/tools/ml.lua (renamed from xmake/core/platform/windows/tools/ml.lua)2
-rw-r--r--xmake/platforms/windows/tools/nmake.lua (renamed from xmake/core/platform/windows/tools/nmake.lua)2
-rw-r--r--xmake/platforms/windows/windows.lua (renamed from xmake/core/platform/windows/windows.lua)0
53 files changed, 99 insertions, 68 deletions
diff --git a/xmake/core/action/_clean.lua b/xmake/core/action/_clean.lua
index 677ff2470..71ed1280b 100644
--- a/xmake/core/action/_clean.lua
+++ b/xmake/core/action/_clean.lua
@@ -28,7 +28,7 @@ local clean = require("base/clean")
local config = require("base/config")
local project = require("base/project")
local utils = require("base/utils")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _clean.need(name)
diff --git a/xmake/core/action/_config.lua b/xmake/core/action/_config.lua
index a883b0499..9cf0af08e 100644
--- a/xmake/core/action/_config.lua
+++ b/xmake/core/action/_config.lua
@@ -28,7 +28,7 @@ local utils = require("base/utils")
local config = require("base/config")
local project = require("base/project")
local makefile = require("base/makefile")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _config.need(name)
diff --git a/xmake/core/action/_debug.lua b/xmake/core/action/_debug.lua
index c84d78073..aba8d363e 100644
--- a/xmake/core/action/_debug.lua
+++ b/xmake/core/action/_debug.lua
@@ -26,7 +26,7 @@ local _debug = _debug or {}
-- load modules
local utils = require("base/utils")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _debug.need(name)
diff --git a/xmake/core/action/_global.lua b/xmake/core/action/_global.lua
index a8fffa0bc..2ccf85901 100644
--- a/xmake/core/action/_global.lua
+++ b/xmake/core/action/_global.lua
@@ -26,7 +26,7 @@ local _global = _global or {}
-- load modules
local utils = require("base/utils")
local global = require("base/global")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _global.need(name)
diff --git a/xmake/core/action/_install.lua b/xmake/core/action/_install.lua
index 28ef3650d..788584fdd 100644
--- a/xmake/core/action/_install.lua
+++ b/xmake/core/action/_install.lua
@@ -30,7 +30,7 @@ local global = require("base/global")
local install = require("base/install")
local package = require("base/package")
local project = require("base/project")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _install.need(name)
diff --git a/xmake/core/action/_lua.lua b/xmake/core/action/_lua.lua
index e342d82e7..0ca841b83 100644
--- a/xmake/core/action/_lua.lua
+++ b/xmake/core/action/_lua.lua
@@ -30,7 +30,7 @@ local utils = require("base/utils")
local config = require("base/config")
local string = require("base/string")
local tools = require("tools/tools")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _lua.need(name)
diff --git a/xmake/core/action/_man.lua b/xmake/core/action/_man.lua
index feb70dd92..14a2b1e5a 100644
--- a/xmake/core/action/_man.lua
+++ b/xmake/core/action/_man.lua
@@ -26,7 +26,7 @@ local _man = _man or {}
-- load modules
local utils = require("base/utils")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _man.need(name)
diff --git a/xmake/core/action/_package.lua b/xmake/core/action/_package.lua
index e39604a33..d55af5ada 100644
--- a/xmake/core/action/_package.lua
+++ b/xmake/core/action/_package.lua
@@ -32,7 +32,7 @@ local global = require("base/global")
local string = require("base/string")
local project = require("base/project")
local package = require("base/package")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _package.need(name)
diff --git a/xmake/core/action/_run.lua b/xmake/core/action/_run.lua
index 64649fcb8..31a73dbc8 100644
--- a/xmake/core/action/_run.lua
+++ b/xmake/core/action/_run.lua
@@ -29,7 +29,7 @@ local path = require("base/path")
local utils = require("base/utils")
local config = require("base/config")
local project = require("base/project")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _run.need(name)
diff --git a/xmake/core/action/_uninstall.lua b/xmake/core/action/_uninstall.lua
index 8f82907d6..93c944b3e 100644
--- a/xmake/core/action/_uninstall.lua
+++ b/xmake/core/action/_uninstall.lua
@@ -31,7 +31,7 @@ local install = require("base/install")
local uninstall = require("base/uninstall")
local package = require("base/package")
local project = require("base/project")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- need access to the given file?
function _uninstall.need(name)
diff --git a/xmake/core/action/action.lua b/xmake/core/action/action.lua
index 96e51b5d8..deeacab57 100644
--- a/xmake/core/action/action.lua
+++ b/xmake/core/action/action.lua
@@ -30,7 +30,7 @@ local utils = require("base/utils")
local global = require("base/global")
local config = require("base/config")
local project = require("base/project")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- load the given action
function action._load(name)
diff --git a/xmake/core/base/compiler.lua b/xmake/core/base/compiler.lua
index a64f8bae0..3a9cd6b51 100644
--- a/xmake/core/base/compiler.lua
+++ b/xmake/core/base/compiler.lua
@@ -32,7 +32,7 @@ local table = require("base/table")
local string = require("base/string")
local config = require("base/config")
local tools = require("tools/tools")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- map gcc flag to the given compiler flag
function compiler._mapflag(module, flag)
diff --git a/xmake/core/base/install.lua b/xmake/core/base/install.lua
index 9fc41a14a..5da8e55d1 100644
--- a/xmake/core/base/install.lua
+++ b/xmake/core/base/install.lua
@@ -30,7 +30,7 @@ local rule = require("base/rule")
local path = require("base/path")
local utils = require("base/utils")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- install target from the project script
function install._done_from_project(target)
diff --git a/xmake/core/base/linker.lua b/xmake/core/base/linker.lua
index 9a0388757..2a484db34 100644
--- a/xmake/core/base/linker.lua
+++ b/xmake/core/base/linker.lua
@@ -30,7 +30,7 @@ local string = require("base/string")
local config = require("base/config")
local compiler = require("base/compiler")
local tools = require("tools/tools")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- map gcc flag to the given linker flag
function linker._mapflag(module, flag)
diff --git a/xmake/core/base/makefile.lua b/xmake/core/base/makefile.lua
index 826310d1a..3521dfb9c 100644
--- a/xmake/core/base/makefile.lua
+++ b/xmake/core/base/makefile.lua
@@ -34,7 +34,7 @@ local project = require("base/project")
local linker = require("base/linker")
local compiler = require("base/compiler")
local tools = require("tools/tools")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- make object for the *.[o|obj] source file
function makefile._make_object_for_object(file, target, srcfile, objfile)
diff --git a/xmake/core/base/package.lua b/xmake/core/base/package.lua
index ffb1a0d38..5bfe7850b 100644
--- a/xmake/core/base/package.lua
+++ b/xmake/core/base/package.lua
@@ -30,7 +30,7 @@ local rule = require("base/rule")
local path = require("base/path")
local utils = require("base/utils")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- package target for the library file
function package._done_library(target)
diff --git a/xmake/core/base/path.lua b/xmake/core/base/path.lua
index eb35283b2..51b92dcb5 100644
--- a/xmake/core/base/path.lua
+++ b/xmake/core/base/path.lua
@@ -24,7 +24,8 @@
local path = path or {}
-- load modules
-local string = require("base/string")
+local utils = require("base/utils")
+local string = require("base/string")
-- get the directory of the path
function path.directory(p)
@@ -60,6 +61,11 @@ end
-- get the file extension of the path: .xxx
function path.extension(p)
+
+ -- check
+ assert(p)
+
+ -- get extension
local i = p:find_last(".", true)
if i then
return p:sub(i)
@@ -68,5 +74,20 @@ function path.extension(p)
end
end
+-- join path
+function path.join(p, ...)
+
+ -- check
+ assert(p)
+
+ -- join them
+ for _, name in ipairs({...}) do
+ p = p .. "/" .. name
+ end
+
+ -- translate path
+ return path.translate(p)
+end
+
-- return module: path
return path
diff --git a/xmake/core/platform/platform.lua b/xmake/core/base/platform.lua
index 2fc411cbf..5ecfc33fc 100644
--- a/xmake/core/platform/platform.lua
+++ b/xmake/core/base/platform.lua
@@ -30,11 +30,21 @@ local utils = require("base/utils")
local config = require("base/config")
local global = require("base/global")
+-- load platform directories
+function platform._load_directories()
+
+ -- load platform directories
+ return { path.join(config.directory(), "platforms")
+ , path.join(global.directory(), "platforms")
+ , path.join(xmake._PROGRAM_DIR, "platforms")
+ }
+end
+
-- load prober the given platform directory
-function platform._load_prober(root)
+function platform._load_prober(platdir)
-- the platform file path
- local filepath = string.format("%s/prober.lua", root)
+ local filepath = path.join(platdir, "prober.lua")
if os.isfile(filepath) then
-- load script
@@ -52,11 +62,11 @@ function platform._load_prober(root)
end
end
--- load the given platform from the given root directory
-function platform._load_from(root, plat)
+-- load the given platform from the given directory
+function platform._load_from(dir, plat)
-- the platform file path
- local filepath = string.format("%s/platform/%s/%s.lua", root, plat, plat)
+ local filepath = path.join(dir, plat, plat .. ".lua")
if os.isfile(filepath) then
-- load script
@@ -84,6 +94,9 @@ end
-- load the given platform
function platform._load(plat)
+ -- check
+ assert(plat)
+
-- the module
platform._MODULES = platform._MODULES or {}
local module = platform._MODULES[plat]
@@ -91,14 +104,16 @@ function platform._load(plat)
-- return it directory if ok
if module then return module end
- -- attempt to load it from the project configure directory
- if not module then module = platform._load_from(config.directory(), plat) end
+ -- load module
+ local dirs = platform._load_directories()
+ for _, dir in ipairs(dirs) do
- -- attempt to load it from the global configure directory
- if not module then module = platform._load_from(global.directory(), plat) end
+ module = platform._load_from(dir, plat)
+ if module then
+ break
+ end
- -- attempt to load it from the script directory
- if not module then module = platform._load_from(xmake._CORE_DIR, plat) end
+ end
-- cache it if ok
if module then
@@ -112,6 +127,9 @@ end
-- get the configure of the given platform
function platform._configs(plat)
+ -- check
+ assert(plat)
+
-- the configure
platform._CONFIGS = platform._CONFIGS or {}
local configs = platform._CONFIGS[plat]
@@ -140,8 +158,12 @@ end
-- get the current platform module
function platform.module()
- -- load it
- return platform._load(config.get("plat"))
+ -- get the platform
+ local plat = config.get("plat")
+ if plat then
+ -- load it
+ return platform._load(plat)
+ end
end
-- get the current platform module directory
@@ -241,29 +263,17 @@ function platform.plats()
-- make list
local list = {}
+ local dirs = platform._load_directories()
+ for _, dir in ipairs(dirs) do
- -- get the platform list from the project configure directory
- local plats = os.match(config.directory() .. "/platform/*", true)
- if plats then
- for _, v in ipairs(plats) do
- table.insert(list, path.basename(v))
+ -- get the platform list
+ local plats = os.match(path.join(dir, "*"), true)
+ if plats then
+ for _, v in ipairs(plats) do
+ table.insert(list, path.basename(v))
+ end
end
- end
- -- get the platform list from the global configure directory
- plats = os.match(global.directory() .. "/platform/*", true)
- if plats then
- for _, v in ipairs(plats) do
- table.insert(list, path.basename(v))
- end
- end
-
- -- get the platform list from the script directory
- plats = os.match(xmake._CORE_DIR .. "/platform/*", true)
- if plats then
- for _, v in ipairs(plats) do
- table.insert(list, path.basename(v))
- end
end
-- save it
diff --git a/xmake/core/base/project.lua b/xmake/core/base/project.lua
index 51b46afe3..9ea8a2fac 100644
--- a/xmake/core/base/project.lua
+++ b/xmake/core/base/project.lua
@@ -33,7 +33,7 @@ local table = require("base/table")
local config = require("base/config")
local linker = require("base/linker")
local compiler = require("base/compiler")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- import module
function project._api_import(env, module)
diff --git a/xmake/core/base/rule.lua b/xmake/core/base/rule.lua
index b3dc1825c..a74113b4f 100644
--- a/xmake/core/base/rule.lua
+++ b/xmake/core/base/rule.lua
@@ -29,7 +29,7 @@ local path = require("base/path")
local table = require("base/table")
local utils = require("base/utils")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- get the building log file path
function rule.logfile()
diff --git a/xmake/core/base/uninstall.lua b/xmake/core/base/uninstall.lua
index 304b73c92..e10d6a9ca 100644
--- a/xmake/core/base/uninstall.lua
+++ b/xmake/core/base/uninstall.lua
@@ -30,7 +30,7 @@ local rule = require("base/rule")
local path = require("base/path")
local utils = require("base/utils")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- uninstall target from the platform script
function uninstall._done_from_platform(target)
diff --git a/xmake/core/tools/gcc.lua b/xmake/core/tools/gcc.lua
index ab5e94ccb..6cc995d60 100644
--- a/xmake/core/tools/gcc.lua
+++ b/xmake/core/tools/gcc.lua
@@ -25,7 +25,7 @@ local utils = require("base/utils")
local table = require("base/table")
local string = require("base/string")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- define module: gcc
local gcc = gcc or {}
diff --git a/xmake/core/tools/swiftc.lua b/xmake/core/tools/swiftc.lua
index 39142705f..29a2b64e4 100644
--- a/xmake/core/tools/swiftc.lua
+++ b/xmake/core/tools/swiftc.lua
@@ -25,7 +25,7 @@ local utils = require("base/utils")
local table = require("base/table")
local string = require("base/string")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- define module: swiftc
local swiftc = swiftc or {}
diff --git a/xmake/core/tools/tools.lua b/xmake/core/tools/tools.lua
index a61322d3c..7ae54fdec 100644
--- a/xmake/core/tools/tools.lua
+++ b/xmake/core/tools/tools.lua
@@ -28,7 +28,7 @@ local os = require("base/os")
local path = require("base/path")
local utils = require("base/utils")
local string = require("base/string")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- match the tool name
function tools._match(name, toolname)
diff --git a/xmake/core/platform/android/android.lua b/xmake/platforms/android/android.lua
index 15e3c33a2..15e3c33a2 100644
--- a/xmake/core/platform/android/android.lua
+++ b/xmake/platforms/android/android.lua
diff --git a/xmake/core/platform/android/prober.lua b/xmake/platforms/android/prober.lua
index a6446e0e1..a6446e0e1 100644
--- a/xmake/core/platform/android/prober.lua
+++ b/xmake/platforms/android/prober.lua
diff --git a/xmake/core/platform/iphoneos/iphoneos.lua b/xmake/platforms/iphoneos/iphoneos.lua
index f9147945c..f9147945c 100644
--- a/xmake/core/platform/iphoneos/iphoneos.lua
+++ b/xmake/platforms/iphoneos/iphoneos.lua
diff --git a/xmake/core/platform/iphoneos/package.lua b/xmake/platforms/iphoneos/package.lua
index 1e46ddadc..654050ab7 100644
--- a/xmake/core/platform/iphoneos/package.lua
+++ b/xmake/platforms/iphoneos/package.lua
@@ -29,7 +29,7 @@ local path = require("base/path")
local rule = require("base/rule")
local utils = require("base/utils")
local string = require("base/string")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- package target
function package.main(target)
diff --git a/xmake/core/platform/iphoneos/prober.lua b/xmake/platforms/iphoneos/prober.lua
index 0de95c783..0de95c783 100644
--- a/xmake/core/platform/iphoneos/prober.lua
+++ b/xmake/platforms/iphoneos/prober.lua
diff --git a/xmake/core/platform/iphonesimulator/iphonesimulator.lua b/xmake/platforms/iphonesimulator/iphonesimulator.lua
index 4ceeb3eca..4ceeb3eca 100644
--- a/xmake/core/platform/iphonesimulator/iphonesimulator.lua
+++ b/xmake/platforms/iphonesimulator/iphonesimulator.lua
diff --git a/xmake/core/platform/iphonesimulator/prober.lua b/xmake/platforms/iphonesimulator/prober.lua
index a4c69c72a..a4c69c72a 100644
--- a/xmake/core/platform/iphonesimulator/prober.lua
+++ b/xmake/platforms/iphonesimulator/prober.lua
diff --git a/xmake/core/platform/linux/install.lua b/xmake/platforms/linux/install.lua
index 870cf5040..1505b0d97 100644
--- a/xmake/core/platform/linux/install.lua
+++ b/xmake/platforms/linux/install.lua
@@ -29,7 +29,7 @@ local path = require("base/path")
local rule = require("base/rule")
local utils = require("base/utils")
local string = require("base/string")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- install target for the library file
function install._done_library(target)
diff --git a/xmake/core/platform/linux/linux.lua b/xmake/platforms/linux/linux.lua
index 406dc5c58..406dc5c58 100644
--- a/xmake/core/platform/linux/linux.lua
+++ b/xmake/platforms/linux/linux.lua
diff --git a/xmake/core/platform/linux/prober.lua b/xmake/platforms/linux/prober.lua
index 4e50b13cf..4e50b13cf 100644
--- a/xmake/core/platform/linux/prober.lua
+++ b/xmake/platforms/linux/prober.lua
diff --git a/xmake/core/platform/macosx/uninstall.lua b/xmake/platforms/linux/uninstall.lua
index 468692620..62f00a239 100644
--- a/xmake/core/platform/macosx/uninstall.lua
+++ b/xmake/platforms/linux/uninstall.lua
@@ -29,7 +29,7 @@ local path = require("base/path")
local rule = require("base/rule")
local utils = require("base/utils")
local string = require("base/string")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- uninstall target for the library file
function uninstall._done_library(target)
diff --git a/xmake/core/platform/macosx/install.lua b/xmake/platforms/macosx/install.lua
index 870cf5040..1505b0d97 100644
--- a/xmake/core/platform/macosx/install.lua
+++ b/xmake/platforms/macosx/install.lua
@@ -29,7 +29,7 @@ local path = require("base/path")
local rule = require("base/rule")
local utils = require("base/utils")
local string = require("base/string")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- install target for the library file
function install._done_library(target)
diff --git a/xmake/core/platform/macosx/macosx.lua b/xmake/platforms/macosx/macosx.lua
index 088a01c18..088a01c18 100644
--- a/xmake/core/platform/macosx/macosx.lua
+++ b/xmake/platforms/macosx/macosx.lua
diff --git a/xmake/core/platform/macosx/prober.lua b/xmake/platforms/macosx/prober.lua
index e2571fdd9..e2571fdd9 100644
--- a/xmake/core/platform/macosx/prober.lua
+++ b/xmake/platforms/macosx/prober.lua
diff --git a/xmake/core/platform/linux/uninstall.lua b/xmake/platforms/macosx/uninstall.lua
index 468692620..62f00a239 100644
--- a/xmake/core/platform/linux/uninstall.lua
+++ b/xmake/platforms/macosx/uninstall.lua
@@ -29,7 +29,7 @@ local path = require("base/path")
local rule = require("base/rule")
local utils = require("base/utils")
local string = require("base/string")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- uninstall target for the library file
function uninstall._done_library(target)
diff --git a/xmake/core/platform/mingw/mingw.lua b/xmake/platforms/mingw/mingw.lua
index 7264489b2..7264489b2 100644
--- a/xmake/core/platform/mingw/mingw.lua
+++ b/xmake/platforms/mingw/mingw.lua
diff --git a/xmake/core/platform/mingw/prober.lua b/xmake/platforms/mingw/prober.lua
index 575e3a7ba..575e3a7ba 100644
--- a/xmake/core/platform/mingw/prober.lua
+++ b/xmake/platforms/mingw/prober.lua
diff --git a/xmake/core/platform/watchos/package.lua b/xmake/platforms/watchos/package.lua
index 1e46ddadc..654050ab7 100644
--- a/xmake/core/platform/watchos/package.lua
+++ b/xmake/platforms/watchos/package.lua
@@ -29,7 +29,7 @@ local path = require("base/path")
local rule = require("base/rule")
local utils = require("base/utils")
local string = require("base/string")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- package target
function package.main(target)
diff --git a/xmake/core/platform/watchos/prober.lua b/xmake/platforms/watchos/prober.lua
index 1a818dfdf..1a818dfdf 100644
--- a/xmake/core/platform/watchos/prober.lua
+++ b/xmake/platforms/watchos/prober.lua
diff --git a/xmake/core/platform/watchos/watchos.lua b/xmake/platforms/watchos/watchos.lua
index 9551084f8..9551084f8 100644
--- a/xmake/core/platform/watchos/watchos.lua
+++ b/xmake/platforms/watchos/watchos.lua
diff --git a/xmake/core/platform/watchsimulator/prober.lua b/xmake/platforms/watchsimulator/prober.lua
index d33059c36..d33059c36 100644
--- a/xmake/core/platform/watchsimulator/prober.lua
+++ b/xmake/platforms/watchsimulator/prober.lua
diff --git a/xmake/core/platform/watchsimulator/watchsimulator.lua b/xmake/platforms/watchsimulator/watchsimulator.lua
index a13bfde1e..a13bfde1e 100644
--- a/xmake/core/platform/watchsimulator/watchsimulator.lua
+++ b/xmake/platforms/watchsimulator/watchsimulator.lua
diff --git a/xmake/core/platform/windows/prober.lua b/xmake/platforms/windows/prober.lua
index 40d214efd..1a64b320c 100644
--- a/xmake/core/platform/windows/prober.lua
+++ b/xmake/platforms/windows/prober.lua
@@ -29,7 +29,7 @@ local string = require("base/string")
local config = require("base/config")
local global = require("base/global")
local tools = require("tools/tools")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- define module: prober
local prober = prober or {}
diff --git a/xmake/core/platform/windows/tools/cl.lua b/xmake/platforms/windows/tools/cl.lua
index 299960bb8..faf5d94c5 100644
--- a/xmake/core/platform/windows/tools/cl.lua
+++ b/xmake/platforms/windows/tools/cl.lua
@@ -27,7 +27,7 @@ local cl = cl or {}
local utils = require("base/utils")
local string = require("base/string")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- init the compiler
function cl.init(self, name)
diff --git a/xmake/core/platform/windows/tools/lib.lua b/xmake/platforms/windows/tools/lib.lua
index 1d94152cc..7f1cd79ee 100644
--- a/xmake/core/platform/windows/tools/lib.lua
+++ b/xmake/platforms/windows/tools/lib.lua
@@ -30,7 +30,7 @@ local path = require("base/path")
local utils = require("base/utils")
local string = require("base/string")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- init the compiler
function lib.init(self, name)
diff --git a/xmake/core/platform/windows/tools/link.lua b/xmake/platforms/windows/tools/link.lua
index 66476fa41..66cc4c0d6 100644
--- a/xmake/core/platform/windows/tools/link.lua
+++ b/xmake/platforms/windows/tools/link.lua
@@ -27,7 +27,7 @@ local link = link or {}
local utils = require("base/utils")
local string = require("base/string")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- init the compiler
function link.init(self, name)
diff --git a/xmake/core/platform/windows/tools/ml.lua b/xmake/platforms/windows/tools/ml.lua
index 5a6034320..3736c8105 100644
--- a/xmake/core/platform/windows/tools/ml.lua
+++ b/xmake/platforms/windows/tools/ml.lua
@@ -27,7 +27,7 @@ local ml = ml or {}
local utils = require("base/utils")
local string = require("base/string")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- init the compiler
function ml.init(self, name)
diff --git a/xmake/core/platform/windows/tools/nmake.lua b/xmake/platforms/windows/tools/nmake.lua
index 3dddc7cf2..020872eeb 100644
--- a/xmake/core/platform/windows/tools/nmake.lua
+++ b/xmake/platforms/windows/tools/nmake.lua
@@ -26,7 +26,7 @@ local path = require("base/path")
local utils = require("base/utils")
local string = require("base/string")
local config = require("base/config")
-local platform = require("platform/platform")
+local platform = require("base/platform")
-- define module: nmake
local nmake = nmake or {}
diff --git a/xmake/core/platform/windows/windows.lua b/xmake/platforms/windows/windows.lua
index 794358dc1..794358dc1 100644
--- a/xmake/core/platform/windows/windows.lua
+++ b/xmake/platforms/windows/windows.lua