diff options
| author | ruki <[email protected]> | 2025-12-12 09:54:46 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-12 09:54:46 +0800 |
| commit | 7544d22a944cb4702534a8fe54924d74a71d3178 (patch) | |
| tree | 2df690db9f7ead09afde33fd321864c4d56b042a /xmake/modules/utils/binary/bin2c.lua | |
| parent | 2427bd350baa6331c5dfd62b2ab291737c7e5f49 (diff) | |
| parent | e08e654aad4f829fcf1990dae32a14394055d96c (diff) | |
Merge pull request #7120 from xmake-io/ar
Add extractlib support in binutils
Diffstat (limited to 'xmake/modules/utils/binary/bin2c.lua')
| -rw-r--r-- | xmake/modules/utils/binary/bin2c.lua | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/xmake/modules/utils/binary/bin2c.lua b/xmake/modules/utils/binary/bin2c.lua index 34d9c4e02..7bbc797a4 100644 --- a/xmake/modules/utils/binary/bin2c.lua +++ b/xmake/modules/utils/binary/bin2c.lua @@ -20,16 +20,8 @@ -- imports import("core.base.bytes") -import("core.base.option") import("core.base.binutils") -local options = { - {'w', "linewidth", "kv", nil, "Set the line width"}, - {nil, "nozeroend", "k", false, "Disable to patch zero terminating character"}, - {'i', "binarypath", "kv", nil, "Set the binary file path."}, - {'o', "outputpath", "kv", nil, "Set the output file path."} -} - function _do_dump(binarydata, outputfile, opt) local i = 0 local n = 147 @@ -71,7 +63,7 @@ function _do_dump(binarydata, outputfile, opt) end end -function _do_bin2c(binarypath, outputpath, opt) +function main(binarypath, outputpath, opt) -- init source directory and options opt = opt or {} @@ -117,15 +109,3 @@ function _do_bin2c(binarypath, outputpath, opt) cprint("${bright}%s generated!", outputpath) end -function main(...) - - -- parse arguments - local argv = {...} - local opt = option.parse(argv, options, "Print c/c++ code files from the given binary file." - , "" - , "Usage: xmake l utils.binary.bin2c [options]") - - -- do bin2c - _do_bin2c(opt.binarypath, opt.outputpath, opt) -end - |
