-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yml
More file actions
27 lines (25 loc) · 939 Bytes
/
Taskfile.yml
File metadata and controls
27 lines (25 loc) · 939 Bytes
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
# https://taskfile.dev
version: '3'
tasks:
generate-llvm:
cmds:
- clang -S -emit-llvm {{ .CLI_ARGS }}.c -o {{ .CLI_ARGS }}.ll
desc: Generate LLVM IR from C source file
compile-llvm:
cmds:
- clang {{ .CLI_ARGS }}.ll -c -o {{ .CLI_ARGS }}.o
- clang {{ .CLI_ARGS }}.o $(find . -wholename './dist/lib/*.o') -o {{ .CLI_ARGS }}
- ./{{ .CLI_ARGS }}
desc: Compile LLVM IR to executable
compile-compiler:
cmds:
- make
- ./dist/1cc --output dist/compiler/{{ .CLI_ARGS }}.ll src/{{ .CLI_ARGS }}.c
- clang dist/compiler/{{ .CLI_ARGS }}.ll -c -o dist/compiler/{{ .CLI_ARGS }}.o
- clang dist/compiler/{{ .CLI_ARGS }}.o $(find . -wholename './dist/lib/*.o') -o dist/compiler/{{ .CLI_ARGS }}
desc: Compile C source file with 1cc
compile-c:
cmds:
- clang {{ .CLI_ARGS }}.c -o {{ .CLI_ARGS }}
- ./{{ .CLI_ARGS }}
desc: Compile C source file to executable