Skip to content

Commit 73098ea

Browse files
authored
Merge pull request #3 from bhansconnect/main
Add AFL Scripts to build
2 parents 032984e + 0ea10b9 commit 73098ea

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

build.zig

+20
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub fn build(b: *std.Build) !void {
1818

1919
// Dependencies
2020
const AFLplusplus_dep = b.dependency("AFLplusplus", .{});
21+
const AFLplusplus_root_path = AFLplusplus_dep.path(".");
2122
const AFLplusplus_src_path = AFLplusplus_dep.path("src/");
2223
const AFLplusplus_utl_path = AFLplusplus_dep.path("utils/");
2324
const AFLplusplus_inc_path = AFLplusplus_dep.path("include/");
@@ -363,6 +364,14 @@ pub fn build(b: *std.Build) !void {
363364

364365
b.default_step.dependOn(util_libs_step);
365366

367+
// Install afl scripts
368+
const scripts_step = b.step("scripts", "Install afl scripts");
369+
for (SCRIPTS) |script| {
370+
const install_script = b.addInstallBinFile(AFLplusplus_root_path.path(b, script), script);
371+
scripts_step.dependOn(&install_script.step);
372+
}
373+
b.default_step.dependOn(scripts_step);
374+
366375
// Formatting checks
367376
const fmt_step = b.step("fmt", "Run formatting checks");
368377

@@ -694,3 +703,14 @@ const UTIL_LIB_FLAGS = .{
694703
"-fno-sanitize-trap=undefined",
695704
"-D_FORTIFY_SOURCE=2",
696705
};
706+
707+
const SCRIPTS = [_][]const u8{
708+
"afl-addseeds",
709+
"afl-cmin",
710+
"afl-cmin.bash",
711+
"afl-persistent-config",
712+
"afl-plot",
713+
"afl-system-config",
714+
"afl-whatsup",
715+
"afl-wine-trace",
716+
};

0 commit comments

Comments
 (0)