diff options
Diffstat (limited to 'roms/edk2/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/harnesses/makefile')
-rw-r--r-- | roms/edk2/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/harnesses/makefile | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/roms/edk2/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/harnesses/makefile b/roms/edk2/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/harnesses/makefile new file mode 100644 index 000000000..b32429550 --- /dev/null +++ b/roms/edk2/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma/harnesses/makefile @@ -0,0 +1,68 @@ +# makefile for harness +SRC = ../src +CFLAGS = -I$(SRC) -Wall -g -fsanitize=fuzzer,address -fno-omit-frame-pointer +CFLAGS_M = -I$(SRC) -Wall -g -fsanitize=fuzzer-no-link,address -fno-omit-frame-pointer -DSTANDALONE +ONIG_LIB = $(SRC)/.libs/libonig.a +LIBS = $(ONIG_LIB) + +TARGETS = fuzzer-encode fuzzer-syntax fuzzer-utf16-be fuzzer-utf16-le \ + fuzzer-regset \ + read-encode read-syntax read-utf16-be read-utf16-le read-regset + +OTHER_TARGETS = libfuzzer-onig libfuzzer-onig-full fuzzer-deluxe read-deluxe + + +default: $(TARGETS) + +fuzzer-encode: base.c $(ONIG_LIB) + clang $(CFLAGS) $< $(LIBS) -o $@ + +fuzzer-syntax: base.c $(ONIG_LIB) + clang -DSYNTAX_TEST $(CFLAGS) $< $(LIBS) -o $@ + +fuzzer-deluxe: deluxe.c $(ONIG_LIB) + clang $(CFLAGS) $< $(LIBS) -o $@ + +fuzzer-utf16-be: base.c $(ONIG_LIB) + clang -DUTF16_BE $(CFLAGS) $< $(LIBS) -o $@ + +fuzzer-utf16-le: base.c $(ONIG_LIB) + clang -DUTF16_LE $(CFLAGS) $< $(LIBS) -o $@ + +fuzzer-regset: regset.c $(ONIG_LIB) + clang $(CFLAGS) $< $(LIBS) -o $@ + +read-encode: base.c $(ONIG_LIB) + clang $(CFLAGS_M) $< $(LIBS) -o $@ + +read-syntax: base.c $(ONIG_LIB) + clang -DSYNTAX_TEST $(CFLAGS_M) $< $(LIBS) -o $@ + +read-deluxe: deluxe.c $(ONIG_LIB) + clang $(CFLAGS_M) $< $(LIBS) -o $@ + +read-utf16-be: base.c $(ONIG_LIB) + clang -DUTF16_BE $(CFLAGS_M) $< $(LIBS) -o $@ + +read-utf16-le: base.c $(ONIG_LIB) + clang -DUTF16_LE $(CFLAGS_M) $< $(LIBS) -o $@ + +read-regset: regset.c $(ONIG_LIB) + clang $(CFLAGS_M) $< $(LIBS) -o $@ + +libfuzzer-onig: libfuzzer-onig.cpp $(ONIG_LIB) + clang++ $(CFLAGS) $< $(LIBS) -o $@ + +libfuzzer-onig-full: libfuzzer-onig.cpp $(ONIG_LIB) + clang++ -DFULL_TEST $(CFLAGS) $< $(LIBS) -o $@ + + +$(ONIG_LIB): + cd ..; make clean + #cd ..; autoreconf -vfi + cd ..; ./configure CC=clang LD=clang CFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" + cd ..; make -j4 + + +clean: + rm -f $(TARGETS) $(OTHER_TARGETS) |