forked from uds-se/FormatFuzzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.am
More file actions
35 lines (26 loc) · 847 Bytes
/
Makefile.am
File metadata and controls
35 lines (26 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# FormatFuzzer Makefile. Edit these rules in `Makefile.am' only.
# By default, we build a `gif' fuzzer
bin_PROGRAMS = gif-fuzzer
gif_fuzzer_SOURCES = gif.cpp fuzzer.cpp
# Libraries to use (png needs -lz)
LIBS = -lz
# Where the .bt templates are
TEMPLATES = templates/
# The create script
FFCOMPILE = ./ffcompile
# Create a C++ file from template (say, 'gif.cpp' from template 'gif.bt')
%.cpp: $(TEMPLATES)%.bt
$(FFCOMPILE) $< $@
# Keep generated .cpp files
.PRECIOUS: %.cpp
# How to create the fuzzer (say, 'gif-fuzzer')
%-fuzzer$(EXEEXT): %.o fuzzer.o
@rm -f $@
$(AM_V_CXXLD)$(CXXLINK) $+ $(LIBS)
# How to create the fuzzer as a shared library (say, 'gif.so')
%.so: %.cpp fuzzer.cpp
@rm -f $@
$(AM_V_CXXLD)$(CXXLINK) -shared -fPIC $+ $(LIBS)
# Create a random file (say, 'make random.gif')
random.%: %-fuzzer$(EXEEXT)
./$< fuzz $@