-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
84 lines (74 loc) · 2 KB
/
Taskfile.yml
File metadata and controls
84 lines (74 loc) · 2 KB
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
77
78
79
80
81
82
83
84
# See https://taskfile.dev for more information
version: '3'
vars:
LIB: '{{default "../../src" .LIB_SRC}}'
tasks:
build:program:
cmds:
# Make the destination directory
- mkdir -p bin
# Compile the program ("-O1 -mpush-args" ensure the arguments are passed via the stack instead of registers)
- g++ {{if eq .DEBUG "true"}} -g{{end}} -O1 -mpush-args src/main.cpp src/simple_math.cpp src/simple_math.hpp -o ./bin/main
desc: Build the program
label: 'build:program (Debug: {{eq .DEBUG "true"}})'
silent: true
sources:
- src/main.cpp
- src/simple_math.cpp
- src/simple_math.hpp
generates:
- ./bin/main
build:proxy:
cmds:
# Make the destination directory
- mkdir -p bin
# Compile the proxy
- g++ {{if eq .DEBUG "true"}}-D VERBOSE -g{{end}} -I {{.LIB}} src/proxy.cpp {{.SRC}} -o bin/proxy -l elf
vars:
# Headers
SRC:
sh: 'find {{.LIB}} -type f -printf "%p " -regex ".*\.(?:cpp|hpp)"'
desc: Build the proxy
label: 'build:proxy (Debug: {{eq .DEBUG "true"}}, library: {{.LIB}}, sources: {{adler32sum .SRC}})'
silent: true
sources:
- src/proxy.cpp
- '{{.LIB}}/*'
generates:
- bin/proxy
symbols:program:
cmds:
- nm -C ./bin/main | grep add
deps:
- build:program
desc: Lists the relevant (filtered) symbols from the program
silent: true
symbols:proxy:
cmds:
- nm -C bin/proxy | grep add
deps:
- build:proxy
desc: Lists the relevant (filtered) symbols from the proxy
silent: true
clean:
cmds:
# Delete the directory
- cmd: rm bin -r
ignore_error: true
desc: Clean everything
silent: true
run:no-proxy:
cmds:
- ./bin/main
deps:
- build:program
desc: Run the program without the proxy
silent: true
run:proxy:
cmds:
- bin/proxy ./bin/main
deps:
- build:program
- build:proxy
desc: Run the program with the proxy
silent: true