-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrebuild.cpp
More file actions
29 lines (24 loc) · 1.16 KB
/
rebuild.cpp
File metadata and controls
29 lines (24 loc) · 1.16 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
#include "_rebuild/rebuild.h"
int main(int argc, char **argv) {
std::string cflags = "-Iinclude";
system("mkdir -p build");
rebuild_targets.push_back(
Target::create("build/libyhook.so", {"build/yhook_pic.o"},
"gcc -fPIC -shared -o build/libyhook.so #DEPENDS"));
rebuild_targets.push_back(Target::create("build/libyhook.a",
{"build/yhook.o"},
"ar rcs build/libyhook.a #DEPENDS"));
rebuild_targets.push_back(
CTarget::create("build/yhook.o", {"src/yhook.c"},
"gcc -c -o build/yhook.o #DEPENDS " + cflags));
rebuild_targets.push_back(
CTarget::create("build/yhook_pic.o", {"src/yhook.c"},
"gcc -fPIC -c -o build/yhook_pic.o #DEPENDS" + cflags));
rebuild_targets.push_back(CTarget::create(
"build/yhook_example1", {"src/example1.c", "build/libyhook.a"},
"gcc -o build/yhook_example1 #DEPENDS " + cflags));
rebuild_targets.push_back(CTarget::create(
"build/yhook_example2", {"src/example2.cpp", "build/libyhook.a"},
"g++ -o build/yhook_example2 #DEPENDS " + cflags));
return 0;
}