aboutsummaryrefslogtreecommitdiff
path: root/tests/ossfuzz
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ossfuzz')
-rw-r--r--tests/ossfuzz/Makefile13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/ossfuzz/Makefile b/tests/ossfuzz/Makefile
index 747fb662..008cd7df 100644
--- a/tests/ossfuzz/Makefile
+++ b/tests/ossfuzz/Makefile
@@ -1,7 +1,12 @@
-fuzz: fuzz.c
- $(CC) $(CFLAGS) -c fuzz.c -I ../../src/liblzma/api/
- $(CXX) $(CXXFLAGS) $(LIB_FUZZING_ENGINE) fuzz.o -o $(OUT)/fuzz \
- ../../src/liblzma/.libs/liblzma.a
+FUZZ_TARGET_SRCS = $(wildcard *.c)
+FUZZ_TARGET_BINS = $(FUZZ_TARGET_SRCS:.c=)
+
+all: $(FUZZ_TARGET_BINS)
+
+%: %.c
+ $(CC) $(CFLAGS) -c $< -I ../../src/liblzma/api/ ;
+ $(CXX) $(CXXFLAGS) $(LIB_FUZZING_ENGINE) $(<:.c=.o) -o $(OUT)/$@ \
+ ../../src/liblzma/.libs/liblzma.a ;
clean:
rm -f *.o