-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
76 lines (62 loc) · 1.83 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
version: "3"
################################################################################################
tasks:
fmt:
cmds:
- magic run mojo format -l 120 .
################################################################################################
# 编译 c 动态库
build:c:dynamic:
aliases: [ 'bc', "bcd" ]
cmds:
- mkdir -p build/
- cc -shared -fPIC src/clib.c -o build/clib.so
- cc -c src/clib.c -O -o build/clib.o
ignore_error: true
# 编译 + 运行 c 动态库
build:run:dynamic:
aliases: [ 'brd' ]
cmds:
- task: bcd
- magic run mojo build src/main.mojo -o build/mainDynamic
- ./build/mainDynamic
# 运行 c 动态库
run:dynamic:
aliases: [ 'r', 'rd' ]
cmds:
- task: bcd
- magic run mojo src/main.mojo
################################################################################################
# 编译 c 静态库
build:c:static:
aliases: [ 'bcs' ]
cmds:
- mkdir -p build/
- gcc -static -c src/clib.c -o build/libclib.a
# TODO X: 目前有报错, 似乎 mojoc 去掉后, 不支持编译静态库
# 编译 + 运行 c 静态库
build:run:static:
aliases: [ 'brs' ]
cmds:
- task: bcs
- magic run mojo build src/main2.mojo -I build/libclib.a -o build/mainStatic
- ./build/mainStatic
#
# TODO X: 目前有报错, 似乎 mojoc 去掉后, 不支持编译静态库
#
# 运行 c 静态库
run:static:
aliases: [ 'rs' ]
cmds:
- task: bcs
- magic run mojo src/main2.mojo -I build/libclib.a
################################################################################################
clean:
aliases: [ 'cl', 'del' ]
cmds:
- rm -rf build/
ignore_error: true
pkg:
aliases: [ 'pm', 'magic' ]
cmds:
- magic {{.CLI_ARGS}}