aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md40
1 files changed, 40 insertions, 0 deletions
diff --git a/README.md b/README.md
index a50ec484..73e28fa1 100644
--- a/README.md
+++ b/README.md
@@ -252,6 +252,46 @@ hello`main:
You can also use short command option, for exmaple: `xmake r` or `xmake run`
</p>
+## Project Examples
+
+#### Executale Program
+
+```lua
+target("test")
+ set_kind("binary")
+ add_files("src/*c")
+```
+
+#### Static Library Program
+
+```lua
+target("library")
+ set_kind("static")
+ add_files("src/library/*.c")
+
+target("test")
+ set_kind("binary")
+ add_files("src/*c")
+ add_deps("library")
+```
+
+We use `add_deps` to link a static library to test target.
+
+#### Share Library Program
+
+```lua
+target("library")
+ set_kind("shared")
+ add_files("src/library/*.c")
+
+target("test")
+ set_kind("binary")
+ add_files("src/*c")
+ add_deps("library")
+```
+
+We use `add_deps` to link a share library to test target.
+
## Configuration
Set compilation configuration before building project with command `xmake f|config`.