diff options
Diffstat (limited to 'guide/quickstart.md')
| -rw-r--r-- | guide/quickstart.md | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/guide/quickstart.md b/guide/quickstart.md new file mode 100644 index 00000000..afcbde9d --- /dev/null +++ b/guide/quickstart.md @@ -0,0 +1,86 @@ +## Usage Video + +[](https://asciinema.org/a/133693) + +## Create Project + +```bash +$ xmake create -l c -P ./hello +``` + +And xmake will generate some files for c language project: + +``` +hello +├── src +│ └── main.c +└── xmake.lua +``` + +It is a simple console program only for printing `hello xmake!` + +The content of `xmake.lua` is very simple: + +```lua +target("hello") + set_kind("binary") + add_files("src/*.c") +``` + +Support languages: + +* c/c++ +* objc/c++ +* cuda +* asm +* swift +* dlang +* golang +* rust + +<p class="tip"> + If you want to known more options, please run: `xmake create --help` +</p> + +## Build Project + +```bash +$ xmake +``` + +## Run Program + +```bash +$ xmake run hello +``` + +## Debug Program + +```bash +$ xmake run -d hello +``` + +It will start the debugger (.e.g lldb, gdb, windbg, vsjitdebugger, ollydbg ..) to load our program. + +```bash +[lldb]$target create "build/hello" +Current executable set to 'build/hello' (x86_64). +[lldb]$b main +Breakpoint 1: where = hello`main, address = 0x0000000100000f50 +[lldb]$r +Process 7509 launched: '/private/tmp/hello/build/hello' (x86_64) +Process 7509 stopped +* thread #1: tid = 0x435a2, 0x0000000100000f50 hello`main, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 + frame #0: 0x0000000100000f50 hello`main +hello`main: +-> 0x100000f50 <+0>: pushq %rbp + 0x100000f51 <+1>: movq %rsp, %rbp + 0x100000f54 <+4>: leaq 0x2b(%rip), %rdi ; "hello world!" + 0x100000f5b <+11>: callq 0x100000f64 ; symbol stub for: puts +[lldb]$ +``` + +<p class="tip"> + You can also use short command option, for exmaple: `xmake r` or `xmake run` +</p> + |
