-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
80 lines (71 loc) · 1.81 KB
/
Taskfile.yml
File metadata and controls
80 lines (71 loc) · 1.81 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
# See https://taskfile.dev for more information
version: '3'
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:
# Generate Makefiles
- cmake -B lib {{if eq .DEBUG "true"}} -DDEBUG=ON{{end}} .
# Build
- cmake --build lib
desc: Build the proxy
label: 'build:proxy (Debug: {{eq .DEBUG "true"}})'
silent: true
sources:
- CMakeLists.txt
- src/proxy.cpp
generates:
- lib/*
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 lib/libproxy.so | grep qbdipreload_on_run
deps:
- build:proxy
desc: Lists the relevant (filtered) symbols from the proxy
silent: true
clean:
cmds:
# Delete the directories
- cmd: rm bin lib -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/main
deps:
- build:program
- build:proxy
desc: Run the program with the proxy
env:
LD_BIND_NOW: 1
LD_PRELOAD: ./lib/libproxy.so
silent: true