diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/zstd/contrib/linux-kernel/test/Makefile | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/zstd/contrib/linux-kernel/test/Makefile')
-rw-r--r-- | src/zstd/contrib/linux-kernel/test/Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/zstd/contrib/linux-kernel/test/Makefile b/src/zstd/contrib/linux-kernel/test/Makefile new file mode 100644 index 00000000..8411462c --- /dev/null +++ b/src/zstd/contrib/linux-kernel/test/Makefile @@ -0,0 +1,43 @@ + +IFLAGS := -isystem include/ -I ../include/ -I ../lib/zstd/ -isystem googletest/googletest/include -isystem ../../../lib/common/ + +SOURCES := $(wildcard ../lib/zstd/*.c) +OBJECTS := $(patsubst %.c,%.o,$(SOURCES)) + +ARFLAGS := rcs +CXXFLAGS += -std=c++11 -g -O3 -Wcast-align +CFLAGS += -g -O3 -Wframe-larger-than=400 -Wcast-align +CPPFLAGS += $(IFLAGS) + +../lib/zstd/libzstd.a: $(OBJECTS) + $(AR) $(ARFLAGS) $@ $^ + +DecompressCrash: DecompressCrash.o $(OBJECTS) libFuzzer.a + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ + +RoundTripCrash: RoundTripCrash.o $(OBJECTS) ../lib/xxhash.o libFuzzer.a + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ + +UserlandTest: UserlandTest.cpp ../lib/zstd/libzstd.a ../lib/xxhash.o + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $^ googletest/build/googlemock/gtest/libgtest.a googletest/build/googlemock/gtest/libgtest_main.a -o $@ + +XXHashUserlandTest: XXHashUserlandTest.cpp ../lib/xxhash.o ../../../lib/common/xxhash.o + $(CXX) $(CXXFLAGS) $(CFLAGS) $(CPPFLAGS) $^ googletest/build/googlemock/gtest/libgtest.a googletest/build/googlemock/gtest/libgtest_main.a -o $@ + +# Install libfuzzer +libFuzzer.a: + @$(RM) -rf Fuzzer + @git clone https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer + @./Fuzzer/build.sh + +# Install googletest +.PHONY: googletest +googletest: + @$(RM) -rf googletest + @git clone https://github.com/google/googletest + @mkdir -p googletest/build + @cd googletest/build && cmake .. && $(MAKE) + +clean: + $(RM) -f *.{o,a} ../lib/zstd/*.{o,a} ../lib/*.o + $(RM) -f DecompressCrash RoundTripCrash UserlandTest XXHashUserlandTest |