From a4118ed8664be06ed5ac8ebcdd4e6bfc0e9a0d6d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 14 May 2017 00:28:55 +0200 Subject: [PATCH] fuzz: makefile adjustments --- configure.ac | 1 + tests/fuzz/Makefile.am | 38 ++++++++++++++++++++++++++++++++++++-- tests/fuzz/Makefile.inc | 26 +++++++++++++------------- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index 5ef731260..042b2d045 100644 --- a/configure.ac +++ b/configure.ac @@ -3892,10 +3892,11 @@ AC_CONFIG_FILES([Makefile \ tests/certs/scripts/Makefile \ tests/data/Makefile \ tests/server/Makefile \ tests/libtest/Makefile \ tests/unit/Makefile \ + tests/fuzz/Makefile \ packages/Makefile \ packages/Win32/Makefile \ packages/Win32/cygwin/Makefile \ packages/Linux/Makefile \ packages/Linux/RPM/Makefile \ diff --git a/tests/fuzz/Makefile.am b/tests/fuzz/Makefile.am index 487deff41..e77dcb708 100644 --- a/tests/fuzz/Makefile.am +++ b/tests/fuzz/Makefile.am @@ -3,11 +3,11 @@ # Project ___| | | | _ \| | # / __| | | | |_) | | # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at https://curl.haxx.se/docs/copyright.html. # @@ -17,8 +17,42 @@ # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # ########################################################################### +AUTOMAKE_OPTIONS = foreign nostdinc +# Specify our include paths here, and do it relative to $(top_srcdir) and +# $(top_builddir), to ensure that these paths which belong to the library +# being currently built and tested are searched before the library which +# might possibly already be installed in the system. +# +# $(top_builddir)/include/curl for generated curlbuild.h included from curl.h +# $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h +# $(top_srcdir)/include is for libcurl's external include files +# $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file +# $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files + +AM_CPPFLAGS = -I$(top_builddir)/include/curl \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/tests/fuzz + +EXTRA_DIST = Makefile.inc CMakeLists.txt + +# Prevent LIBS from being used for all link targets +LIBS = $(BLANK_AT_MAKETIME) + +LDADD = $(top_builddir)/src/libcurltool.la \ + $(top_builddir)/lib/libcurlu.la \ + @LDFLAGS@ @LIBCURL_LIBS@ + +# Makefile.inc provides neat definitions +include Makefile.inc + +checksrc: + @PERL@ $(top_srcdir)/lib/checksrc.pl $(srcdir)/*.c + +noinst_PROGRAMS = $(FUZZPROGS) -# FIXME, probably adapt from file in ../unit diff --git a/tests/fuzz/Makefile.inc b/tests/fuzz/Makefile.inc index fa4ae1c7d..fb6cdb11a 100644 --- a/tests/fuzz/Makefile.inc +++ b/tests/fuzz/Makefile.inc @@ -1,19 +1,19 @@ -FUZZER_HTTP11 = curl_fuzzer.c -FUZZER_HTTP11_CPPFLAGS = $(AM_CPPFLAGS) +FUZZPROGS = http11 ftp imap pop3 httpupload http2 +http11_SOURCES = curl_fuzzer.c +http11_CPPFLAGS = $(AM_CPPFLAGS) -FUZZER_FTP = curl_fuzzer.c -FUZZER_FTP_CPPFLAGS = -DFUZZER_FTP $(AM_CPPFLAGS) +ftp_SOURCES = curl_fuzzer.c +ftp_CPPFLAGS = -DFUZZER_FTP $(AM_CPPFLAGS) -FUZZER_IMAP = curl_fuzzer.c -FUZZER_IMAP_CPPFLAGS = -DFUZZER_IMAP $(AM_CPPFLAGS) +imap_SOURCES = curl_fuzzer.c +imap_CPPFLAGS = -DFUZZER_IMAP $(AM_CPPFLAGS) -FUZZER_POP3 = curl_fuzzer.c -FUZZER_POP3_CPPFLAGS = -DFUZZER_POP3 $(AM_CPPFLAGS) +pop3_SOURCES = curl_fuzzer.c +pop3_CPPFLAGS = -DFUZZER_POP3 $(AM_CPPFLAGS) -FUZZER_HTTP_UPLOAD = curl_fuzzer.c -FUZZER_HTTP_UPLOAD_CPPFLAGS = -DFUZZER_HTTP_UPLOAD $(AM_CPPFLAGS) +httpupload_SOURCES = curl_fuzzer.c +httpupload_CPPFLAGS = -DFUZZER_HTTP_UPLOAD $(AM_CPPFLAGS) - -FUZZER_HTTP2 = curl_fuzzer.c -FUZZER_HTTP2_CPPFLAGS = -DFUZZER_HTTP2 $(AM_CPPFLAGS) +http2_SOURCES = curl_fuzzer.c +http2_CPPFLAGS = -DFUZZER_HTTP2 $(AM_CPPFLAGS) -- 2.11.0