all: static shared
-static: example$(EXE) minigzip$(EXE) fuzzers makefixed$(EXE) maketrees$(EXE) makecrct$(EXE)
+static: example$(EXE) minigzip$(EXE) makefixed$(EXE) maketrees$(EXE) makecrct$(EXE)
shared: examplesh$(EXE) minigzipsh$(EXE)
test: all
$(MAKE) -C test
-# This variable is set by configure.
-WITH_FUZZERS=
-
-# By default, use our own standalone_fuzz_target_runner.
-# This runner does no fuzzing, but simply executes the inputs
-# provided via parameters.
-# Run e.g. "make all LIB_FUZZING_ENGINE=/path/to/libFuzzer.a"
-# to link the fuzzer(s) against a real fuzzing engine.
-ifeq (,$(LIB_FUZZING_ENGINE))
- LIB_FUZZING_ENGINE = standalone_fuzz_target_runner.o
-else
- # OSS-Fuzz will define its own value for LIB_FUZZING_ENGINE.
- WITH_FUZZERS=1
-endif
-
-ifeq (1,$(WITH_FUZZERS))
-fuzzers: fuzzer_checksum$(EXE) fuzzer_compress$(EXE) fuzzer_example_small$(EXE) fuzzer_example_large$(EXE) fuzzer_example_flush$(EXE) fuzzer_example_dict$(EXE) fuzzer_minigzip$(EXE)
-else
-fuzzers:
-endif
-
-# The standalone fuzz target runner.
-standalone_fuzz_target_runner.o:
- $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-fuzzer_checksum.o:
- $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-fuzzer_compress.o:
- $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-fuzzer_example_small.o:
- $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-fuzzer_example_large.o:
- $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-fuzzer_example_flush.o:
- $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-fuzzer_example_dict.o:
- $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-fuzzer_minigzip.o:
- $(CC) $(CFLAGS) -DWITH_GZFILEOP $(INCLUDES) -c -o $@ $<
-fuzzer_checksum$(EXE): fuzzer_checksum.o standalone_fuzz_target_runner.o $(STATICLIB)
- $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_checksum.o $(STATICLIB) -lpthread
-fuzzer_compress$(EXE): fuzzer_compress.o standalone_fuzz_target_runner.o $(STATICLIB)
- $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_compress.o $(STATICLIB) -lpthread
-fuzzer_example_small$(EXE): fuzzer_example_small.o standalone_fuzz_target_runner.o $(STATICLIB)
- $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_example_small.o $(STATICLIB) -lpthread
-fuzzer_example_large$(EXE): fuzzer_example_large.o standalone_fuzz_target_runner.o $(STATICLIB)
- $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_example_large.o $(STATICLIB) -lpthread
-fuzzer_example_flush$(EXE): fuzzer_example_flush.o standalone_fuzz_target_runner.o $(STATICLIB)
- $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_example_flush.o $(STATICLIB) -lpthread
-fuzzer_example_dict$(EXE): fuzzer_example_dict.o standalone_fuzz_target_runner.o $(STATICLIB)
- $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_example_dict.o $(STATICLIB) -lpthread
-fuzzer_minigzip$(EXE): fuzzer_minigzip.o standalone_fuzz_target_runner.o $(OBJG) $(STATICLIB)
- $(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) fuzzer_minigzip.o $(OBJG) $(STATICLIB) -lpthread
-
infcover.o: $(SRCDIR)/test/infcover.c zlib$(SUFFIX).h zconf$(SUFFIX).h zlib_name_mangling$(SUFFIX).h
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/infcover.c
@if [ -f $(ARCHDIR)/Makefile ]; then $(MAKE) -C $(ARCHDIR) clean; fi
@if [ -f test/Makefile ]; then $(MAKE) -C test clean; fi
rm -f *.o *.lo *~ \
- example$(EXE) minigzip$(EXE) minigzipsh$(EXE) fuzzer_*$(EXE) \
+ example$(EXE) minigzip$(EXE) minigzipsh$(EXE) \
infcover makefixed$(EXE) maketrees$(EXE) makecrct$(EXE) \
$(STATICLIB) $(IMPORTLIB) $(SHAREDLIB) $(SHAREDLIBV) $(SHAREDLIBM) \
foo.gz so_locations \
| WITH_NEW_STRATEGIES | --without-new-strategies | Use new strategies | ON |
| WITH_NATIVE_INSTRUCTIONS | --native | Compiles with full instruction set supported on this host (gcc/clang -march=native) | OFF |
| WITH_SANITIZER | --with-sanitizer | Build with sanitizer (memory, address, undefined) | OFF |
-| WITH_FUZZERS | --with-fuzzers | Build test/fuzz | OFF |
+| WITH_FUZZERS | | Build test/fuzz | OFF |
| WITH_BENCHMARKS | | Build test/benchmarks | OFF |
| WITH_MAINTAINER_WARNINGS | | Build with project maintainer warnings | OFF |
| WITH_CODE_COVERAGE | | Enable code coverage reporting | OFF |
builddfltccinflate=0
buildcrc32vx=1
with_sanitizer=""
-with_fuzzers=0
floatabi=
native=0
forcesse2=0
echo ' [--force-sse2] Assume SSE2 instructions are always available (disabled by default on x86, enabled on x86_64)' | tee -a configure.log
echo ' [--force-tzcnt] Assume TZCNT instructions are always available (disabled by default)' | tee -a configure.log
echo ' [--with-sanitizer] Build with sanitizer (memory, address, undefined)' | tee -a configure.log
- echo ' [--with-fuzzers] Build test/fuzz (disabled by default)' | tee -a configure.log
echo ' [--native] Compiles with full instruction set supported on this host' | tee -a configure.log
exit 0 ;;
-p*=* | --prefix=*) prefix=$(echo $1 | sed 's/.*=//'); shift ;;
-w* | --warn) warn=1; shift ;;
-d* | --debug) debug=1; shift ;;
--with-sanitizer=*) with_sanitizer=$(echo $1 | sed 's/.*=//'); shift ;;
- --with-fuzzers) with_fuzzers=1; shift ;;
*)
echo "unknown option: $1" | tee -a configure.log
sed < $SRCDIR/Makefile.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
-/^WITH_FUZZERS *=/s#=.*#=$with_fuzzers#
/^SFLAGS *=/s#=.*#=$SFLAGS#
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
/^LDSHARED *=/s#=.*#=$LDSHARED#
/^SRCDIR *=/s#=.*#=$SRCDIR/test#
/^SRCTOP *=/s#=.*#=$SRCDIR#
/^QEMU_RUN *=/s#=.*#=$QEMU_RUN#
-/^WITH_FUZZERS *=/s#=.*#=$with_fuzzers#
/^LIBNAME *=/s#=.*#=$LIBNAME#
" > test/Makefile
SRCTOP=
LIBNAME=
TEST_LDFLAGS=-L.. ../$(LIBNAME).a
-WITH_FUZZERS=
QEMU_RUN=
QEMU_VER:=$(shell command -v $(QEMU_RUN) --version 2> /dev/null)
-all: oldtests cvetests fuzzer ghtests
+all: oldtests cvetests ghtests
oldtests: #set by ../configure
check_cross_dep:
ALL_SRC_FILES := $(wildcard ../*)
-# Only check the fuzzer when it is a stand-alone executable.
-ifneq (,$(LIB_FUZZING_ENGINE))
-fuzzer:
-else
- ifeq (0,$(WITH_FUZZERS))
-fuzzer:
- else
-fuzzer:
- @${QEMU_RUN} ../fuzzer_checksumr$(EXE) $(ALL_SRC_FILES) && \
- ${QEMU_RUN} ../fuzzer_compress$(EXE) $(ALL_SRC_FILES) && \
- ${QEMU_RUN} ../fuzzer_example_small$(EXE) $(ALL_SRC_FILES) && \
- ${QEMU_RUN} ../fuzzer_example_large$(EXE) $(ALL_SRC_FILES) && \
- ${QEMU_RUN} ../fuzzer_example_flush$(EXE) $(ALL_SRC_FILES) && \
- ${QEMU_RUN} ../fuzzer_example_dict$(EXE) $(ALL_SRC_FILES) && \
- ${QEMU_RUN} ../fuzzer_minigzip$(EXE) $(ALL_SRC_FILES)
- endif
-endif
-
teststatic: check_cross_dep
@TMPST=tmpst_$$$$; \
HELLOST=tmphellost_$$$$; \