Compare commits

...

4 commits

Author SHA1 Message Date
22dcaafedf top-level Makefile for it 2018-05-08 07:23:57 -05:00
41a361739c fuzzer makefiles: add sanitizer 2018-05-06 22:05:15 -05:00
fd257fbd99 makefile for fuzzing 2018-05-06 22:05:15 -05:00
8e0fb9dac6 Enable use of clang-afl-fast 2018-05-06 22:05:15 -05:00
4 changed files with 80 additions and 0 deletions

9
Makefile Normal file
View file

@ -0,0 +1,9 @@
.PHONY: default
default:
$(MAKE) -C src
$(MAKE) -C examples/tgunzip
.PHONY: %
%:
$(MAKE) -C src $@
$(MAKE) -C examples/tgunzip $@

30
examples/tgunzip/Makefile Normal file
View file

@ -0,0 +1,30 @@
##
## tgunzip - gzip decompressor example
##
## GCC makefile (Linux, FreeBSD, BeOS and QNX)
##
## Copyright (c) 2003 by Joergen Ibsen / Jibz
## All Rights Reserved
##
## http://www.ibsensoftware.com/
##
target = tgunzip
objects = tgunzip.o
libs = ../../lib/libtinf.a
cflags = -Wall -g -I../../src -fsanitize=undefined -fno-sanitize-recover=undefined
ldflags = $(cflags) -Wl,-Map,ld.map
.PHONY: all clean
all: $(target)
$(target): $(objects) $(libs)
/home/jepler/src/afl-2.52b/afl-clang-fast $(ldflags) -o $@ $^ $(libs)
%.o : %.c
/home/jepler/src/afl-2.52b/afl-clang-fast $(cflags) -c $<
clean:
$(RM) $(objects) $(target)

View file

@ -65,6 +65,10 @@ int main(int argc, char *argv[])
uzlib_init();
#ifdef __AFL_HAVE_MANUAL_CONTROL
__AFL_INIT();
#endif
/* -- open files -- */
if ((fin = fopen(argv[1], "rb")) == NULL) exit_error("source file");

37
src/Makefile Normal file
View file

@ -0,0 +1,37 @@
##
## tinflib - tiny inflate library (inflate, gzip, zlib)
##
## GCC makefile (Linux, FreeBSD, BeOS and QNX)
##
## Copyright (c) 2003 by Joergen Ibsen / Jibz
## All Rights Reserved
##
## http://www.ibsensoftware.com/
##
target = ../lib/libtinf.a
objects = tinflate.o tinfgzip.o tinfzlib.o adler32.o crc32.o \
defl_static.o genlz77.o
headers = $(wildcard *.h)
cflags = -Wall -g -fsanitize=undefined -fno-sanitize-recover=undefined
ldflags = $(cflags)
.PHONY: all clean
all: $(target)
$(target): $(objects)
$(RM) $@
ar -frsv $@ $^
ranlib $@
%.o : %.c $(HEADERS)
/home/jepler/src/afl-2.52b/afl-clang-fast $(cflags) -o $@ -c $<
%.o : %.nas
nasm -o $@ -f elf -D_ELF_ -O3 -Inasm/ $<
clean:
$(RM) $(objects) $(target)