-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
78 lines (68 loc) · 2.52 KB
/
Makefile
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
default: all
MAYHEM_DOCKER_REGISTRY ?= docker.io
FUZZME_ORG = forallsecure
BUILD_PREFIX := build/
PUSH_PREFIX := push/
CLEAN_PREFIX := clean/
FUZZERS := \
android/base-executable/android-base-executable \
ada/base-executable/ada-base-executable \
c/afl/c-afl-clang \
c/afl/c-afl-gcc \
c/aflpp/c-aflpp-clang \
c/aflpp/c-aflpp-gcc \
c/base-executable/c-base-executable \
c/base-executable/powerpc-c-base-executable \
c/base-executable/powerpc64-c-base-executable \
c/base-executable/powerpc64le-c-base-executable \
c/honggfuzz/c-honggfuzz-clang \
c/honggfuzz/c-honggfuzz-gcc \
c/libfuzzer/c-libfuzzer \
cpp/afl/cpp-afl-clang \
cpp/afl/cpp-afl-gcc \
cpp/aflpp/cpp-aflpp-clang \
cpp/aflpp/cpp-aflpp-gcc \
cpp/base-executable/cpp-base-executable \
cpp/honggfuzz/cpp-honggfuzz-clang \
cpp/honggfuzz/cpp-honggfuzz-gcc \
cpp/libfuzzer/cpp-libfuzzer \
csharp/libfuzzer/csharp-sharpfuzz \
fortran/base-executable/fortran-base-executable \
go/base-executable/go-base-executable \
go/libfuzzer/go-go-fuzz \
java/base-executable/java-base-executable \
java/libfuzzer/java-jazzer \
kotlin/libfuzzer/kotlin-jazzer \
objective-c/base-executable/obj-c-base-executable \
ocaml/afl/ocaml-afl \
ocaml/base-executable/ocaml-base-executable \
python/libfuzzer/python-atheris \
rust/afl/rust-afl \
rust/base-executable/rust-base-executable \
rust/libfuzzer/rust-cargo-fuzz \
swift/libfuzzer/swift-libfuzzer
BUILD_FUZZERS := $(addprefix $(BUILD_PREFIX), $(FUZZERS))
PUSH_FUZZERS := $(addprefix $(PUSH_PREFIX), $(FUZZERS))
CLEAN_FUZZERS := $(addprefix $(CLEAN_PREFIX), $(FUZZERS))
all:
@echo "make build or make push to make things happen"
.PHONY: build
build: $(BUILD_FUZZERS)
$(BUILD_FUZZERS):
$(eval IMAGE_FUZZER := $(@:$(BUILD_PREFIX)%=%))
$(eval SPLIT_IMAGE_FUZZER = $(subst /, ,$(IMAGE_FUZZER)))
$(eval SPLIT_IMAGE_FUZZER_3 = $(word 3, $(SPLIT_IMAGE_FUZZER)))
docker build -t $(MAYHEM_DOCKER_REGISTRY)/$(FUZZME_ORG)/$(SPLIT_IMAGE_FUZZER_3) $(IMAGE_FUZZER)
.PHONY: push
push: $(PUSH_FUZZERS)
$(PUSH_FUZZERS):
$(eval IMAGE_FUZZER := $(@:$(PUSH_PREFIX)%=%))
$(eval SPLIT_IMAGE_FUZZER = $(subst /, ,$(IMAGE_FUZZER)))
$(eval SPLIT_IMAGE_FUZZER_3 = $(word 3, $(SPLIT_IMAGE_FUZZER)))
docker push $(MAYHEM_DOCKER_REGISTRY)/$(FUZZME_ORG)/$(SPLIT_IMAGE_FUZZER_3)
clean: $(CLEAN_FUZZERS)
$(CLEAN_FUZZERS):
$(eval IMAGE_FUZZER := $(@:$(CLEAN_PREFIX)%=%))
$(eval SPLIT_IMAGE_FUZZER = $(subst /, ,$(IMAGE_FUZZER)))
$(eval SPLIT_IMAGE_FUZZER_3 = $(word 3, $(SPLIT_IMAGE_FUZZER)))
docker rmi $(MAYHEM_DOCKER_REGISTRY)/$(FUZZME_ORG)/$(SPLIT_IMAGE_FUZZER_3)