1#  FLAC - Free Lossless Audio Codec
2#  Copyright (C) 2019  Xiph.Org Foundation
3#
4#  This file is part the FLAC project.  FLAC is comprised of several
5#  components distributed under different licenses.  The codec libraries
6#  are distributed under Xiph.Org's BSD-like license (see the file
7#  COPYING.Xiph in this distribution).  All other programs, libraries, and
8#  plugins are distributed under the GPL (see COPYING.GPL).  The documentation
9#  is distributed under the Gnu FDL (see COPYING.FDL).  Each file in the
10#  FLAC distribution contains at the top the terms under which it may be
11#  distributed.
12#
13#  Since this particular file is relevant to all components of FLAC,
14#  it may be distributed under the Xiph.Org license, which is the least
15#  restrictive of those mentioned above.  See the file COPYING.Xiph in this
16#  distribution.
17
18AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/oss-fuzz
19
20AM_CXXFLAGS = -std=c++11
21
22EXTRA_DIST = \
23	fuzz-encoder.dict \
24	fuzzing/Readme.md \
25	fuzzing/datasource/datasource.hpp \
26	fuzzing/datasource/id.hpp \
27	fuzzing/exception.hpp \
28	fuzzing/memory.hpp \
29	fuzzing/types.hpp
30
31if USE_OSSFUZZ_FLAG
32FUZZ_FLAG = $(LIB_FUZZING_ENGINE)
33FUZZ_LDADD = -lFuzzer
34else
35if USE_OSSFUZZ_STATIC
36FUZZ_LDADD = $(LIB_FUZZING_ENGINE)
37FUZZ_FLAG = -lFuzzer
38endif
39endif
40
41noinst_PROGRAMS =
42
43if USE_OSSFUZZERS
44noinst_PROGRAMS += fuzz-decoder fuzz-encoder
45endif
46
47fuzz_decoder_SOURCES = fuzz-decoder.cc
48fuzz_decoder_CXXFLAGS = $(AM_CXXFLAGS) $(FUZZ_FLAG)
49fuzz_decoder_LDFLAGS = $(AM_LDFLAGS) -static
50fuzz_decoder_LDADD = $(flac_libs) $(FUZZ_LDADD)
51
52fuzz_encoder_SOURCES = fuzz-encoder.cc
53fuzz_encoder_CXXFLAGS = $(AM_CXXFLAGS) $(FUZZ_FLAG)
54fuzz_encoder_LDFLAGS = $(AM_LDFLAGS) -static
55fuzz_encoder_LDADD = $(flac_libs) $(FUZZ_LDADD)
56
57flac_libs = \
58	$(top_builddir)/src/libFLAC/libFLAC-static.la \
59	$(top_builddir)/src/libFLAC++/libFLAC++-static.la \
60	@OGG_LIBS@ \
61	-lm
62
63