Lines Matching +full:run +full:- +full:unittests
2 # american fuzzy lop++ - makefile
3 # -----------------------------
13 # https://www.apache.org/licenses/LICENSE-2.0
30 VERSION = $(shell grep '^$(HASH)define VERSION ' ../config.h | cut -d '"' -f2)
32 # PROGS intentionally omit afl-as, which gets installed elsewhere.
34 PROGS = afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze
35 SH_PROGS = afl-plot afl-cmin afl-cmin.bash afl-whatsup afl-addseeds afl-system-config afl-persis…
36 MANPAGES=$(foreach p, $(PROGS) $(SH_PROGS), $(p).8) afl-as.8
39 SYS = $(shell uname -s)
40 ARCH = $(shell uname -m)
45 override CFLAGS_OPT += -DNO_SPLICING
49 override CFLAGS_OPT += -DFANCY_BOXES_NO_UTF
59 override CFLAGS += -fsanitize=undefined -fno-omit-frame-pointer
60 override LDFLAGS += -fsanitize=undefined
65 override CFLAGS += -fsanitize=memory -fno-omit-frame-pointer
66 override LDFLAGS += -fsanitize=memory
70 override CFLAGS += -D__AFL_CODE_COVERAGE=1
73 ifeq "$(findstring android, $(shell $(CC) --version 2>/dev/null))" ""
74 … main() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -flto=full -o .test 2>/dev/null && echo 1 |…
75 CFLAGS_FLTO ?= -flto=full
77 … main() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -flto=thin -o .test 2>/dev/null && echo 1 |…
78 CFLAGS_FLTO ?= -flto=thin
80 …nt main() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -flto -o .test 2>/dev/null && echo 1 || e…
81 CFLAGS_FLTO ?= -flto
87 …) {return 0; }' | $(CC) -fno-move-loop-invariants -fdisable-tree-cunrolli -x c - -o .test 2>/dev/n…
88 # SPECIAL_PERFORMANCE += -fno-move-loop-invariants -fdisable-tree-cunrolli
91 …ain() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -march=native -o .test 2>/dev/null && echo 1 …
94 # CFLAGS_OPT += -march=native
100 # SPECIAL_PERFORMANCE += -march=native
103 # CFLAGS_OPT += -D_FORTIFY_SOURCE=1
107 SDK_LD = -L$(shell xcrun --show-sdk-path)/usr/lib
111 COMPILER_TYPE=$(shell $(CC) --version|grep "Free Software Foundation")
114 CFLAGS_OPT += -Wno-error=format-truncation -Wno-format-truncation
118 LDFLAGS = -lkstat -lrt -lsocket -lnsl
128 CFLAGS_OPT += -static
129 LDFLAGS += -lm -lpthread -lz -lutil
133 $(info Compiling with profiling information, for analysis: gprof ./afl-fuzz gmon.out > prof.txt)
134 override CFLAGS_OPT += -pg -DPROFILING=1
135 override LDFLAGS += -pg
140 override CFLAGS_OPT += -DINTROSPECTION=1
155 override CFLAGS += -ggdb3 -O0 -Wall -Wextra -Werror $(CFLAGS_OPT)
157 CFLAGS ?= -O2 $(CFLAGS_OPT) # -funroll-loops is slower on modern compilers
160 override CFLAGS += -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wno-pointer-arith \
161 -fPIC -I include/ -DAFL_PATH=\"$(HELPER_PATH)\" \
162 -DBIN_PATH=\"$(BIN_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\"
163 # -fstack-protector
166 override CFLAGS += -I /usr/local/include/
167 override LDFLAGS += -L /usr/local/lib/
171 override CFLAGS += -I /usr/local/include/
172 override LDFLAGS += -L /usr/local/lib/
176 override CFLAGS += -I /usr/local/include/ -mno-retpoline
177 override LDFLAGS += -Wl,-z,notext -L /usr/local/lib/
181 override CFLAGS += -I /usr/pkg/include/
182 override LDFLAGS += -L /usr/pkg/lib/
187 override CFLAGS += -DUSEMMAP=1 -Wno-error=format
188 override LDFLAGS += -Wno-deprecated-declarations -lgnu -lnetwork
189 #SPECIAL_PERFORMANCE += -DUSEMMAP=1
192 AFL_FUZZ_FILES = $(wildcard src/afl-fuzz*.c)
194 ifneq "$(shell command -v python3m 2>/dev/null)" ""
195 ifneq "$(shell command -v python3m-config 2>/dev/null)" ""
196 PYTHON_INCLUDE := $(shell python3m-config --includes)
197 PYTHON_VERSION := $(strip $(shell python3m --version 2>&1))
199 ifeq "$(shell python3m-config --embed --libs 2>/dev/null | grep -q lpython && echo 1 )" "1"
200 PYTHON_LIB := $(shell python3m-config --libs --embed --ldflags)
202 PYTHON_LIB := $(shell python3m-config --ldflags)
208 ifneq "$(shell command -v python3 2>/dev/null)" ""
209 ifneq "$(shell command -v python3-config 2>/dev/null)" ""
210 PYTHON_INCLUDE := $(shell python3-config --includes)
211 PYTHON_VERSION := $(strip $(shell python3 --version 2>&1))
213 ifeq "$(shell python3-config --embed --libs 2>/dev/null | grep -q lpython && echo 1 )" "1"
214 PYTHON_LIB := $(shell python3-config --libs --embed --ldflags)
216 PYTHON_LIB := $(shell python3-config --ldflags)
223 ifneq "$(shell command -v python 2>/dev/null)" ""
224 ifneq "$(shell command -v python-config 2>/dev/null)" ""
225 PYTHON_INCLUDE := $(shell python-config --includes)
226 PYTHON_LIB := $(shell python-config --ldflags)
227 PYTHON_VERSION := $(strip $(shell python --version 2>&1))
232 # Old Ubuntu and others dont have python/python3-config so we hardcode 3.7
234 ifneq "$(shell command -v python3.7 2>/dev/null)" ""
235 ifneq "$(shell command -v python3.7-config 2>/dev/null)" ""
236 PYTHON_INCLUDE := $(shell python3.7-config --includes)
237 PYTHON_LIB := $(shell python3.7-config --ldflags)
238 PYTHON_VERSION := $(strip $(shell python3.7 --version 2>&1))
243 # Old Ubuntu and others dont have python/python2-config so we hardcode 2.7
245 ifneq "$(shell command -v python2.7 2>/dev/null)" ""
246 ifneq "$(shell command -v python2.7-config 2>/dev/null)" ""
247 PYTHON_INCLUDE := $(shell python2.7-config --includes)
248 PYTHON_LIB := $(shell python2.7-config --ldflags)
249 PYTHON_VERSION := $(strip $(shell python2.7 --version 2>&1))
255 …ell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)…
257 BUILD_DATE ?= $(shell date "+%Y-%m-%d")
261 override LDFLAGS += -ldl -lrt -lm
265 override CFLAGS += -pthread
266 override LDFLAGS += -lpthread -lm
270 override CFLAGS += -pthread
271 override LDFLAGS += -lpthread -lm
275 override CFLAGS += -pthread
276 override LDFLAGS += -lpthread -lm
279 COMM_HDR = include/alloc-inl.h include/config.h include/debug.h include/types.h
281 …tr @ '\n' | $(CC) $(CFLAGS) -x c - -o .test $(PYTHON_INCLUDE) $(LDFLAGS) $(PYTHON_LIB) 2>/dev/null…
283 …PYFLAGS=-DUSE_PYTHON $(PYTHON_INCLUDE) $(LDFLAGS) $(PYTHON_LIB) -DPYTHON_VERSION="\"$(PYTHON_VERSI…
295 ifeq "$(shell command -v git >/dev/null && git status >/dev/null 2>&1 && echo 1 || echo 0)" "1"
298 ifeq "$(shell command -v svn >/dev/null && svn proplist . 2>/dev/null && echo 1 || echo 0)" "1"
302 …main() { return 0;}' | $(CC) $(CFLAGS) -fsanitize=address -x c - -o .test2 2>/dev/null && echo 1 |…
303 ASAN_CFLAGS=-fsanitize=address -fstack-protector-all -fno-omit-frame-pointer -DASAN_BUILD
304 ASAN_LDFLAGS=-fsanitize=address -fstack-protector-all -fno-omit-frame-pointer
307 …D, 0); return 0;}' | tr @ '\n' | $(CC) $(CFLAGS) -x c - -o .test2 2>/dev/null && echo 1 || echo 0 …
311 override CFLAGS+=-DUSEMMAP=1
312 LDFLAGS += -Wno-deprecated-declarations
317 override CFLAGS += -DUSEMMAP=1
318 LDFLAGS += -Wno-deprecated-declarations
322 all: test_x86 test_shm test_python ready $(PROGS) afl-as llvm gcc_plugin test_build all_done
323 -$(MAKE) -C utils/aflpp_driver
327 …@test -e afl-fuzz && echo "[+] afl-fuzz and supporting tools successfully built" || echo "[-] afl-…
328 …-e afl-llvm-pass.so && echo "[+] LLVM basic mode successfully built" || echo "[-] LLVM mode could …
329 …-e SanitizerCoveragePCGUARD.so && echo "[+] LLVM mode successfully built" || echo "[-] LLVM mode c…
330 …@test -e SanitizerCoverageLTO.so && echo "[+] LLVM LTO mode successfully built" || echo "[-] LLVM …
332 …st -e afl-gcc-pass.so && echo "[+] gcc_mode successfully built" || echo "[-] gcc_mode could not be…
338 -$(MAKE) -j$(nproc) -f GNUmakefile.llvm
339 …@test -e afl-cc || { echo "[-] Compiling afl-cc failed. You seem not to have a working compiler." …
344 -$(MAKE) -f GNUmakefile.gcc_plugin
354 tests: source-only
355 @cd test ; ./test-all.sh
356 @rm -f test/errors
358 .PHONY: performance-tests
359 performance-tests: performance-test
360 .PHONY: test-performance
361 test-performance: performance-test
363 .PHONY: performance-test
364 performance-test: source-only
365 @cd test ; ./test-performance.sh
371 @echo "HELP --- the following make targets exist:"
374 …@echo "binary-only: everything for binary-only fuzzing: frida_mode, nyx_mode, qemu_mode, frida_mod…
375 @echo "source-only: everything for source code fuzzing: nyx_mode, libdislocator, libtokencap"
376 @echo "distrib: everything (for both binary-only and source code fuzzing)"
382 @echo "code-format: format the code, do this before you commit and send a PR please!"
383 …@echo "tests: this runs the test framework. It is more catered for the developers, but if you run …
385 …@echo "document: creates afl-fuzz-document which will only do one run and save all manipulated inp…
386 @echo "help: shows these build options :-)"
388 @echo "Recommended: \"distrib\" or \"source-only\", then \"install\""
392 @echo STATIC - compile AFL++ static
393 …@echo "CODE_COVERAGE - compile the target for code coverage (see docs/instrumentation/README.llvm.…
394 @echo ASAN_BUILD - compiles AFL++ with memory sanitizer for debug purposes
395 @echo UBSAN_BUILD - compiles AFL++ tools with undefined behaviour sanitizer for debug purposes
396 @echo DEBUG - no optimization, -ggdb3, all warnings and -Werror
397 @echo LLVM_DEBUG - shows llvm deprecation warnings
398 @echo PROFILING - compile afl-fuzz with profiling information
399 @echo INTROSPECTION - compile afl-fuzz with mutation introspection
400 @echo NO_PYTHON - disable python support
401 @echo NO_SPLICING - disables splicing mutation in afl-fuzz, not recommended for normal fuzzing
402 …@echo "NO_UTF - do not use UTF-8 for line rendering in status screen (fallback to G1 box drawing, …
403 @echo NO_NYX - disable building nyx mode dependencies
404 @echo "NO_CORESIGHT - disable building coresight (arm64 only)"
405 @echo NO_UNICORN_ARM64 - disable building unicorn on arm64
406 @echo "WAFL_MODE - enable for WASM fuzzing with https://github.com/fgsect/WAFL"
407 @echo AFL_NO_X86 - if compiling on non-intel/amd platforms
408 @echo "LLVM_CONFIG - if your distro doesn't use the standard name for llvm-config (e.g., Debian)"
410 @echo e.g.: make LLVM_CONFIG=llvm-config-16
420 …@echo 'int main() { __asm__("xorb %al, %al"); }' | $(CC) $(CFLAGS) $(LDFLAGS) -w -x c - -o .test1 …
421 @rm -f .test1
431 @rm -f .test2
434 @echo "[-] shmat seems not to be working, switching to mmap implementation"
440 @rm -f .test 2> /dev/null
444 …@echo "[-] You seem to need to install the package python3-dev or python-dev (and perhaps python[3…
449 …@echo "[+] Everything seems to be working, ready to compile. ($(shell $(CC) --version 2>&1|head -n…
451 afl-as: src/afl-as.c include/afl-as.h $(COMM_HDR) | test_x86
452 $(CC) $(CFLAGS) src/$@.c -o $@ $(LDFLAGS)
453 @ln -sf afl-as as
455 src/afl-performance.o : $(COMM_HDR) src/afl-performance.c include/hash.h
456 $(CC) $(CFLAGS) $(CFLAGS_OPT) -Iinclude -c src/afl-performance.c -o src/afl-performance.o
458 src/afl-common.o : $(COMM_HDR) src/afl-common.c include/common.h
459 $(CC) $(CFLAGS) $(CFLAGS_FLTO) -c src/afl-common.c -o src/afl-common.o
461 src/afl-forkserver.o : $(COMM_HDR) src/afl-forkserver.c include/forkserver.h
462 $(CC) $(CFLAGS) $(CFLAGS_FLTO) -c src/afl-forkserver.c -o src/afl-forkserver.o
464 src/afl-sharedmem.o : $(COMM_HDR) src/afl-sharedmem.c include/sharedmem.h
465 $(CC) $(CFLAGS) $(CFLAGS_FLTO) -c src/afl-sharedmem.c -o src/afl-sharedmem.o
467 afl-fuzz: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src…
468 …$(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o …
470 afl-showmap: src/afl-showmap.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-pe…
471 …src/$@.c src/afl-fuzz-mutators.c src/afl-fuzz-python.c src/afl-common.o src/afl-sharedmem.o src/af…
473 afl-tmin: src/afl-tmin.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performa…
474 …STATIC) $(CFLAGS_FLTO) src/$@.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-…
476 afl-analyze: src/afl-analyze.c src/afl-common.o src/afl-sharedmem.o src/afl-performance.o src/afl-f…
477 …STATIC) $(CFLAGS_FLTO) src/$@.c src/afl-common.o src/afl-sharedmem.o src/afl-performance.o src/afl…
479 afl-gotcpu: src/afl-gotcpu.c src/afl-common.o $(COMM_HDR) | test_x86
480 $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) src/$@.c src/afl-common.o -o $@ $(LDFLAGS)
483 document: afl-fuzz-document
485 # document all mutations and only do one run (use with only one input file!)
486 afl-fuzz-document: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-shared…
487 …-D_DEBUG=\"1\" -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) src/afl-common…
489 test/unittests/unit_maybe_alloc.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_maybe_alloc…
490 …@$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_maybe_alloc.c -o test/unittests/unit_maybe_…
492 unit_maybe_alloc: test/unittests/unit_maybe_alloc.o
493 … $(CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf test/unittests/unit_maybe_alloc.o -o test/unittests/u…
494 ./test/unittests/unit_maybe_alloc
496 test/unittests/unit_hash.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_hash.c $(AFL_FUZZ_…
497 @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_hash.c -o test/unittests/unit_hash.o
499 unit_hash: test/unittests/unit_hash.o src/afl-performance.o
500 …@$(CC) $(CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf $^ -o test/unittests/unit_hash $(LDFLAGS) $(ASA…
501 ./test/unittests/unit_hash
503 test/unittests/unit_rand.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_rand.c $(AFL_FUZZ_…
504 @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_rand.c -o test/unittests/unit_rand.o
506 unit_rand: test/unittests/unit_rand.o src/afl-common.o src/afl-performance.o
507 …CC) $(CFLAGS) $(ASAN_CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf $^ -o test/unittests/unit_rand $(L…
508 ./test/unittests/unit_rand
510 test/unittests/unit_list.o : $(COMM_HDR) include/list.h test/unittests/unit_list.c $(AFL_FUZZ_FILES)
511 @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_list.c -o test/unittests/unit_list.o
513 unit_list: test/unittests/unit_list.o
514 …) $(ASAN_CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf test/unittests/unit_list.o -o test/unittests/un…
515 ./test/unittests/unit_list
517 test/unittests/unit_preallocable.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_preallocab…
518 …@$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_preallocable.c -o test/unittests/unit_preal…
520 unit_preallocable: test/unittests/unit_preallocable.o
521 …N_CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf test/unittests/unit_preallocable.o -o test/unittests/u…
522 ./test/unittests/unit_preallocable
526 …@rm -f ./test/unittests/unit_preallocable ./test/unittests/unit_list ./test/unittests/unit_maybe_a…
533 @echo [-] unit tests are skipped on Darwin \(lacks GNU linker feature --wrap\)
536 .PHONY: code-format
537 code-format:
538 ./.custom-format.py -i src/*.c
539 ./.custom-format.py -i include/*.h
540 ./.custom-format.py -i instrumentation/*.h
541 ./.custom-format.py -i instrumentation/*.cc
542 ./.custom-format.py -i instrumentation/*.c
543 ./.custom-format.py -i *.h
544 ./.custom-format.py -i *.c
545 @#./.custom-format.py -i custom_mutators/*/*.c* # destroys libfuzzer :-(
546 @#./.custom-format.py -i custom_mutators/*/*.h # destroys honggfuzz :-(
547 ./.custom-format.py -i utils/*/*.c*
548 ./.custom-format.py -i utils/*/*.h
549 ./.custom-format.py -i test/*.c
550 ./.custom-format.py -i frida_mode/src/*.c
551 ./.custom-format.py -i frida_mode/include/*.h
552 -./.custom-format.py -i frida_mode/src/*/*.c
553 ./.custom-format.py -i qemu_mode/libcompcov/*.c
554 ./.custom-format.py -i qemu_mode/libcompcov/*.cc
555 ./.custom-format.py -i qemu_mode/libcompcov/*.h
556 ./.custom-format.py -i qemu_mode/libqasan/*.c
557 ./.custom-format.py -i qemu_mode/libqasan/*.h
562 test_build: afl-cc afl-gcc afl-as afl-showmap
563 @echo "[*] Testing the CC wrapper afl-cc and its instrumentation output..."
564 …leaks=0 AFL_INST_RATIO=100 AFL_PATH=. ./afl-cc test-instr.c $(LDFLAGS) -o test-instr 2>&1 || (echo…
565 -ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -q -m none -o .test-instr0 ./test-instr < /dev/null
566 -echo 1 | ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr1 ./test-instr
567 @rm -f test-instr
568 …cmp -s .test-instr0 .test-instr1; DR="$$?"; rm -f .test-instr0 .test-instr1; if [ "$$DR" = "0" ]; …
570 @echo "[+] All right, the instrumentation of afl-cc seems to be working!"
571 # @echo "[*] Testing the CC wrapper afl-gcc and its instrumentation output..."
572 …tect_leaks=0 AFL_INST_RATIO=100 AFL_PATH=. ./afl-gcc test-instr.c -o test-instr 2>&1 || (echo "Oop…
573 # ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr0 ./test-instr < /dev/null
574 # echo 1 | ASAN_OPTIONS=detect_leaks=0 ./afl-showmap -m none -q -o .test-instr1 ./test-instr
575 # @rm -f test-instr
576 …cmp -s .test-instr0 .test-instr1; DR="$$?"; rm -f .test-instr0 .test-instr1; if [ "$$DR" = "0" ]; …
577 # gcc -v 2>&1 | grep -q -- --with-as= && ( echo; echo "Gcc is configured not to use an external as…
580 # @echo "[+] All right, the instrumentation of afl-gcc seems to be working!"
582 test_build: afl-cc afl-as afl-showmap
588 …@test -e afl-cc && echo "[+] Main compiler 'afl-cc' successfully built!" || { echo "[-] Main compi…
589 …-e cmplog-instructions-pass.so && echo "[+] LLVM mode for 'afl-cc' successfully built!" || echo "[…
590 …@test -e SanitizerCoverageLTO.so && echo "[+] LLVM LTO mode for 'afl-cc' successfully built!" || e…
591 …-e afl-gcc-pass.so && echo "[+] gcc_plugin for 'afl-cc' successfully built!" || echo "[-] gcc_plug…
592 @echo "[+] All done! Be sure to review the README.md - it's pretty short and useful."
600 …-rf $(PROGS) afl-fuzz-document afl-as as afl-g++ afl-clang afl-clang++ *.o src/*.o *~ a.out core c…
601 -$(MAKE) -f GNUmakefile.llvm clean
602 -$(MAKE) -f GNUmakefile.gcc_plugin clean
603 -$(MAKE) -C utils/libdislocator clean
604 -$(MAKE) -C utils/libtokencap clean
605 -$(MAKE) -C utils/aflpp_driver clean
606 -$(MAKE) -C utils/afl_network_proxy clean
607 -$(MAKE) -C utils/socket_fuzzing clean
608 -$(MAKE) -C utils/argv_fuzzing clean
609 -$(MAKE) -C utils/plot_ui clean
610 -$(MAKE) -C qemu_mode/unsigaction clean
611 -$(MAKE) -C qemu_mode/fastexit clean
612 -$(MAKE) -C qemu_mode/libcompcov clean
613 -$(MAKE) -C qemu_mode/libqasan clean
614 -$(MAKE) -C frida_mode clean
615 …rm -rf nyx_mode/packer/linux_initramfs/init.cpio.gz nyx_mode/libnyx/libnyx/target/release/* nyx_mo…
617 …-test -e coresight_mode/coresight-trace/Makefile && $(MAKE) -C coresight_mode/coresight-trace clea…
618 -test -e qemu_mode/qemuafl/Makefile && $(MAKE) -C qemu_mode/qemuafl clean || true
619 -test -e unicorn_mode/unicornafl/Makefile && $(MAKE) -C unicorn_mode/unicornafl clean || true
620 -test -e nyx_mode/QEMU-Nyx/Makefile && $(MAKE) -C nyx_mode/QEMU-Nyx clean || true
622 rm -rf coresight_mode/coresight_trace
623 rm -rf qemu_mode/qemuafl
624 rm -rf unicorn_mode/unicornafl
629 rm -rf coresight_mode/coresight-trace
630 rm -rf unicorn_mode/unicornafl
631 rm -rf qemu_mode/qemuafl
632 rm -rf nyx_mode/libnyx nyx_mode/packer nyx_mode/QEMU-Nyx
634 git checkout coresight_mode/coresight-trace
639 git checkout nyx_mode/QEMU-Nyx
644 -$(MAKE) -j$(nproc) -f GNUmakefile.llvm
646 -$(MAKE) -f GNUmakefile.gcc_plugin
647 -$(MAKE) -C utils/libdislocator
648 -$(MAKE) -C utils/libtokencap
650 -$(MAKE) -C utils/afl_network_proxy
651 -$(MAKE) -C utils/socket_fuzzing
652 -$(MAKE) -C utils/argv_fuzzing
653 # -$(MAKE) -C utils/plot_ui
654 -$(MAKE) -C frida_mode
658 -$(MAKE) -C coresight_mode
663 -cd nyx_mode && ./build_nyx_support.sh
666 -cd qemu_mode && sh ./build_qemu_support.sh
669 -cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh
672 -cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh
676 .PHONY: binary-only
677 binary-only: test_shm test_python ready $(PROGS)
679 -$(MAKE) -C utils/libdislocator
680 -$(MAKE) -C utils/libtokencap
682 -$(MAKE) -C utils/afl_network_proxy
683 -$(MAKE) -C utils/socket_fuzzing
684 -$(MAKE) -C utils/argv_fuzzing
685 # -$(MAKE) -C utils/plot_ui
686 -$(MAKE) -C frida_mode
690 -$(MAKE) -C coresight_mode
695 -cd nyx_mode && ./build_nyx_support.sh
698 -cd qemu_mode && sh ./build_qemu_support.sh
701 -cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh
704 -cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh
710 …@test -e afl-fuzz && echo "[+] afl-fuzz and supporting tools successfully built" || echo "[-] afl-…
714 …@test -e afl-cs-proxy && echo "[+] coresight_mode successfully built" || echo "[-] coresight_mode …
719 …@test -e libnyx.so && echo "[+] nyx_mode successfully built" || echo "[-] nyx_mode could not be bu…
722 …@test -e afl-qemu-trace && echo "[+] qemu_mode successfully built" || echo "[-] qemu_mode could no…
725 …@test -e unicorn_mode/unicornafl/build_python/libunicornafl.so && echo "[+] unicorn_mode successfu…
728 …@test -e unicorn_mode/unicornafl/build_python/libunicornafl.so && echo "[+] unicorn_mode successfu…
733 .PHONY: source-only
734 source-only: all
735 -$(MAKE) -j$(nproc) -f GNUmakefile.llvm
737 -$(MAKE) -f GNUmakefile.gcc_plugin
738 -$(MAKE) -C utils/libdislocator
739 -$(MAKE) -C utils/libtokencap
741 # -$(MAKE) -C utils/plot_ui
744 -cd nyx_mode && ./build_nyx_support.sh
750 …@test -e afl-fuzz && echo "[+] afl-fuzz and supporting tools successfully built" || echo "[-] afl-…
751 …-e afl-llvm-pass.so && echo "[+] LLVM basic mode successfully built" || echo "[-] LLVM mode could …
752 …-e SanitizerCoveragePCGUARD.so && echo "[+] LLVM mode successfully built" || echo "[-] LLVM mode c…
753 …-e SanitizerCoverageLTO.so && echo "[+] LLVM LTO mode successfully built" || echo "[-] LLVM LTO mo…
755 …st -e afl-gcc-pass.so && echo "[+] gcc_mode successfully built" || echo "[-] gcc_mode could not be…
759 …@test -e libnyx.so && echo "[+] nyx_mode successfully built" || echo "[-] nyx_mode could not be bu…
770 @./$* -h 2>&1 | head -n 3 | tail -n 1 | sed 's/^\.\///' >> $@
774 @./$* -hh 2>&1 | tail -n +4 >> $@
777 …Hauser\" Heuse <mh@mh-sec.de>, Dominik Maier <domenukk@gmail.com>, Andrea Fioraldi <andreafioraldi…
785 …@install -d -m 755 $${DESTDIR}$(BIN_PATH) $${DESTDIR}$(HELPER_PATH) $${DESTDIR}$(DOC_PATH) $${DEST…
786 @rm -f $${DESTDIR}$(BIN_PATH)/afl-plot.sh
787 @rm -f $${DESTDIR}$(BIN_PATH)/afl-as
788 …-f $${DESTDIR}$(HELPER_PATH)/afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH)/afl-llvm-rt-32.o $${DESTDIR}$…
789 …-llvm-dict2file.so afl-llvm-lto-instrumentlist.so afl-llvm-pass.so cmplog-instructions-pass.so cmp…
790 install -m 755 $(PROGS) $(SH_PROGS) $${DESTDIR}$(BIN_PATH)
791 @if [ -f afl-qemu-trace ]; then install -m 755 afl-qemu-trace $${DESTDIR}$(BIN_PATH); fi
792 …@if [ -f utils/plot_ui/afl-plot-ui ]; then install -m 755 utils/plot_ui/afl-plot-ui $${DESTDIR}$(B…
793 …@if [ -f libdislocator.so ]; then set -e; install -m 755 libdislocator.so $${DESTDIR}$(HELPER_PATH…
794 @if [ -f libtokencap.so ]; then set -e; install -m 755 libtokencap.so $${DESTDIR}$(HELPER_PATH); fi
795 @if [ -f libcompcov.so ]; then set -e; install -m 755 libcompcov.so $${DESTDIR}$(HELPER_PATH); fi
796 @if [ -f libqasan.so ]; then set -e; install -m 755 libqasan.so $${DESTDIR}$(HELPER_PATH); fi
797 …@if [ -f afl-fuzz-document ]; then set -e; install -m 755 afl-fuzz-document $${DESTDIR}$(BIN_PATH)…
798 @if [ -f socketfuzz32.so -o -f socketfuzz64.so ]; then $(MAKE) -C utils/socket_fuzzing install; fi
799 @if [ -f argvfuzz32.so -o -f argvfuzz64.so ]; then $(MAKE) -C utils/argv_fuzzing install; fi
800 @if [ -f afl-frida-trace.so ]; then install -m 755 afl-frida-trace.so $${DESTDIR}$(HELPER_PATH); fi
801 @if [ -f libnyx.so ]; then install -m 755 libnyx.so $${DESTDIR}$(HELPER_PATH); fi
802 …@if [ -f utils/afl_network_proxy/afl-network-server ]; then $(MAKE) -C utils/afl_network_proxy ins…
803 …@if [ -f utils/aflpp_driver/libAFLDriver.a ]; then set -e; install -m 644 utils/aflpp_driver/libAF…
804 …@if [ -f utils/aflpp_driver/libAFLQemuDriver.a ]; then set -e; install -m 644 utils/aflpp_driver/l…
805 -$(MAKE) -f GNUmakefile.llvm install
807 -$(MAKE) -f GNUmakefile.gcc_plugin install
809 ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-gcc
810 ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-g++
811 ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-clang
812 ln -sf afl-cc $${DESTDIR}$(BIN_PATH)/afl-clang++
813 @mkdir -m 0755 -p ${DESTDIR}$(MAN_PATH)
814 install -m0644 *.8 ${DESTDIR}$(MAN_PATH)
815 install -m 755 afl-as $${DESTDIR}$(HELPER_PATH)
816 ln -sf afl-as $${DESTDIR}$(HELPER_PATH)/as
817 install -m 644 docs/*.md $${DESTDIR}$(DOC_PATH)
818 cp -r testcases/ $${DESTDIR}$(MISC_PATH)
819 cp -r dictionaries/ $${DESTDIR}$(MISC_PATH)
824 …-cd $${DESTDIR}$(BIN_PATH) && rm -f $(PROGS) $(SH_PROGS) afl-cs-proxy afl-qemu-trace afl-plot-ui a…
825 …-cd $${DESTDIR}$(HELPER_PATH) && rm -f afl-g*.*o afl-llvm-*.*o afl-compiler-*.*o libdislocator.so …
826 -rm -rf $${DESTDIR}$(MISC_PATH)/testcases $${DESTDIR}$(MISC_PATH)/dictionaries
827 -sh -c "ls docs/*.md | sed 's|^docs/|$${DESTDIR}$(DOC_PATH)/|' | xargs rm -f"
828 -cd $${DESTDIR}$(MAN_PATH) && rm -f $(MANPAGES)
829 -rmdir $${DESTDIR}$(BIN_PATH) 2>/dev/null
830 -rmdir $${DESTDIR}$(HELPER_PATH) 2>/dev/null
831 -rmdir $${DESTDIR}$(MISC_PATH) 2>/dev/null
832 -rmdir $${DESTDIR}$(DOC_PATH) 2>/dev/null
833 -rmdir $${DESTDIR}$(MAN_PATH) 2>/dev/null