From a9dd47b7fcde95bbca06485c50326b7b90d930a8 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Wed, 17 Aug 2011 00:13:39 +0200 Subject: Extend -b to generate c/h/obj/o files with embedded bytecode. Supported object file formats: ELF or PE/COFF object files. --- doc/running.html | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'doc') diff --git a/doc/running.html b/doc/running.html index cf1bdc45..109df5df 100644 --- a/doc/running.html +++ b/doc/running.html @@ -118,28 +118,56 @@ are accepted:
  • -l — Only list bytecode.
  • -s — Strip debug info (this is the default).
  • -g — Keep debug info.
  • +
  • -n name — Set module name (default: auto-detect from input name)
  • +
  • -t type — Set output file type (default: auto-detect from output name).
  • +
  • -a arch — Override architecture for object files (default: native).
  • +
  • -o os — Override OS for object files (default: native).
  • -e chunk — Use chunk string as input.
  • - (a single minus sign) — Use stdin as input and/or stdout as output.
  • +The output file type is auto-detected from the extension of the output +file name: +

    + +

    +Notes: +

    + +

    Typical usage examples:

    -luajit -b test.lua test.out                 # Save to test.out
    +luajit -b test.lua test.out                 # Save bytecode to test.out
     luajit -bg test.lua test.out                # Keep debug info
     luajit -be "print('hello world')" test.out  # Save cmdline script
     
     luajit -bl test.lua                         # List to stdout
     luajit -bl test.lua test.txt                # List to test.txt
     luajit -ble "print('hello world')"          # List cmdline script
    +
    +luajit -b test.lua test.obj                 # Generate object file
    +# Link test.obj with your application and load it with require("test")
     
    -

    -Note: A file in bytecode format is auto-detected and can be loaded like -any Lua source file. E.g. directly from the command line or with -loadfile(), dofile() etc. See also -string.dump() for information -on bytecode portability and compatibility. -

    -j cmd[=arg[,arg...]]

    -- cgit v1.2.3-55-g6feb