We create an empty console project first:
```bash
$ xmake create -P ./hello
create hello ...
create ok!👌
```
And xmake will generate some files:
```bash
$ cd ./hello
$ tree .
.
├── src
│ └── main.c
└── xmake.lua
```
It is a simple console program only for printing hello xmake!
```bash
$ cat ./src/main.c
incl继续阅读 »
We recently added a new feature for xmake:
you need not write any make-like file (xmake.lua, makefile.am, cmakelist.txt, etc.) and also build it directly.
It will scan all source files and generate xmake.lua automatically for building project.
And xmake will detect 'main' function in source file in order to distin继续阅读 »
Creat second disk for k8s
In Vagrantfile, add the following customized command to create disk for k8s source code.
The vagrant/virtual box will create a disk with only 10Gi by default, which is not enough for k8s's build & test.继续阅读 »
go build
compile the package named by the import paths and thier dependencies
go build package/*.go
if build *.go, a virtual package command-line-arguments is created internally
$WORK/command-line-arguments/_obj/: stores the obj files继续阅读 »
xmake在xmake.lua中提供了 $(varname) 的语法,来支持内置变量的获取,例如:
lua
add_cxflags("-I$(buildir)")
它将会在在实际编译的时候,将内置的 buildir 变量转换为实际的构建输出目录:-I./build
并且这些变量在自定义脚本中,也是可以支持的,例如:
lua
target("test")
after_build(target)
print("build ok for $(plat)!")
end
这将会在编译完后,输出:
lua
build ok for macosx!
这些内置变量,大部分都是通过配置的时候,缓存的继续阅读 »