summaryrefslogtreecommitdiff
path: root/tools/xmake.lua
diff options
context:
space:
mode:
authorliukangcc <[email protected]>2022-05-04 18:10:09 +0800
committerguo <[email protected]>2022-05-09 09:39:22 +0800
commitb077e91cdfe4bf0504f27db660d553e249f13589 (patch)
tree5f163ff1ac2cfea389b2a72d10273866bfd7b2f3 /tools/xmake.lua
parent6495df717fa8a63e2bc381c32821205a57cd1a4e (diff)
[update] support command: scons --target=xmake
Diffstat (limited to 'tools/xmake.lua')
-rw-r--r--tools/xmake.lua46
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/xmake.lua b/tools/xmake.lua
new file mode 100644
index 0000000000..c09941c483
--- /dev/null
+++ b/tools/xmake.lua
@@ -0,0 +1,46 @@
+add_rules("mode.debug", "mode.release")
+
+toolchain("${toolchain}")
+ set_kind("standalone")
+ set_sdkdir("${sdkdir}")
+toolchain_end()
+
+target("${target}")
+ set_kind("binary")
+ set_toolchains("${toolchain}")
+
+ add_files(
+ ${src_path}
+ )
+
+ add_includedirs(
+ ${inc_path}
+ )
+
+ add_defines(
+ ${define}
+ )
+
+ add_cflags(
+ "${cflags}" ,{force = true}
+ )
+ add_cxxflags(
+ "${cxxflags}" ,{force = true}
+ )
+
+ add_asflags(
+ "${asflags}" ,{force = true}
+ )
+
+ add_ldflags(
+ "${ldflags}" ,{force = true}
+ )
+
+ set_targetdir("./")
+ set_filename("rtthread.elf")
+
+ after_build(function(target)
+ os.exec("${toolchain}-objcopy -O ihex rtthread.elf rtthread.hex")
+ os.exec("${toolchain}-objcopy -O binary rtthread.elf rtthread.bin")
+ os.exec("${toolchain}-size rtthread.elf")
+ end) \ No newline at end of file