Created
December 3, 2024 21:18
-
-
Save izabera/e551d949ddfed4f12ac1b8ff45bb886c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env dumb | |
in: fentry.cpp | |
out: fentry.o | |
cmd: clang++ -std=c++23 -ggdb3 -fPIC -mgeneral-regs-only -c fentry.cpp | |
in: count.cpp | |
out: count.o | |
cmd: clang++ -std=c++23 -ggdb3 -fPIC -c count.cpp | |
in: count.o fentry.o | |
out: count.so | |
cmd: clang++ -std=c++23 -ggdb3 -fPIC -shared -rdynamic count.o fentry.o -o count.so | |
in: user.cpp | |
out: user | |
cmd: clang++ -std=c++23 -ggdb3 -pg -mfentry user.cpp -o user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
check() { | |
[[ ! -e $1 ]] && return | |
for i in ${@:2}; do | |
[[ $1 -ot $i ]] && return | |
done | |
} | |
in: () { in=$*; } | |
out:() { out=$*; } | |
cmd:() { | |
for i in $out; do | |
if check $i $in; then | |
echo cmd: $@ | |
$@ || { e=$?; rm -f $out; exit $e; } | |
break | |
fi | |
done | |
} | |
for i do . $i; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment