Tests: Update OSS-Fuzz Makefile.

All .c files can be built as separate fuzz targets. This simplifies
the Makefile by allowing us to use wildcards instead of having a
Makefile target for each fuzz target.
This commit is contained in:
Maksym Vatsyk 2023-12-04 17:21:29 +01:00 committed by Jia Tan
parent 28ce6a1c2a
commit 37581a77ad
1 changed files with 9 additions and 4 deletions

View File

@ -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