2018-01-06 22:05:16 -07:00
|
|
|
# Copyright (c) 2014-2018, The Monero Project
|
2016-08-29 04:13:55 -06:00
|
|
|
#
|
2015-05-31 05:40:18 -06:00
|
|
|
# All rights reserved.
|
2016-08-29 04:13:55 -06:00
|
|
|
#
|
2015-05-31 05:40:18 -06:00
|
|
|
# Redistribution and use in source and binary forms, with or without modification, are
|
|
|
|
# permitted provided that the following conditions are met:
|
2016-08-29 04:13:55 -06:00
|
|
|
#
|
2015-05-31 05:40:18 -06:00
|
|
|
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
|
|
# conditions and the following disclaimer.
|
2016-08-29 04:13:55 -06:00
|
|
|
#
|
2015-05-31 05:40:18 -06:00
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
|
|
# of conditions and the following disclaimer in the documentation and/or other
|
|
|
|
# materials provided with the distribution.
|
2016-08-29 04:13:55 -06:00
|
|
|
#
|
2015-05-31 05:40:18 -06:00
|
|
|
# 3. Neither the name of the copyright holder nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software without specific
|
|
|
|
# prior written permission.
|
2016-08-29 04:13:55 -06:00
|
|
|
#
|
2015-05-31 05:40:18 -06:00
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
|
|
|
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
|
|
|
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
|
|
|
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2015-01-27 00:43:15 -07:00
|
|
|
all: release-all
|
2014-03-03 15:07:58 -07:00
|
|
|
|
|
|
|
cmake-debug:
|
|
|
|
mkdir -p build/debug
|
|
|
|
cd build/debug && cmake -D CMAKE_BUILD_TYPE=Debug ../..
|
|
|
|
|
2015-01-27 00:43:15 -07:00
|
|
|
debug: cmake-debug
|
2014-03-03 15:07:58 -07:00
|
|
|
cd build/debug && $(MAKE)
|
|
|
|
|
2017-10-08 17:06:37 -06:00
|
|
|
# Temporarily disable some tests:
|
|
|
|
# * libwallet_api_tests fail (Issue #895)
|
2016-08-22 17:43:43 -06:00
|
|
|
debug-test:
|
2014-12-01 11:00:22 -07:00
|
|
|
mkdir -p build/debug
|
2017-10-08 17:06:37 -06:00
|
|
|
cd build/debug && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Debug ../.. && $(MAKE) && $(MAKE) ARGS="-E libwallet_api_tests" test
|
2014-03-03 15:07:58 -07:00
|
|
|
|
2015-01-27 00:43:15 -07:00
|
|
|
debug-all:
|
2014-12-01 11:00:22 -07:00
|
|
|
mkdir -p build/debug
|
2017-07-02 02:12:10 -06:00
|
|
|
cd build/debug && cmake -D BUILD_TESTS=ON -D BUILD_SHARED_LIBS=OFF -D CMAKE_BUILD_TYPE=Debug ../.. && $(MAKE)
|
|
|
|
|
|
|
|
debug-static-all:
|
|
|
|
mkdir -p build/debug
|
|
|
|
cd build/debug && cmake -D BUILD_TESTS=ON -D STATIC=ON -D CMAKE_BUILD_TYPE=Debug ../.. && $(MAKE)
|
2014-03-03 15:07:58 -07:00
|
|
|
|
|
|
|
cmake-release:
|
|
|
|
mkdir -p build/release
|
|
|
|
cd build/release && cmake -D CMAKE_BUILD_TYPE=Release ../..
|
|
|
|
|
2015-01-27 00:43:15 -07:00
|
|
|
release: cmake-release
|
2014-03-03 15:07:58 -07:00
|
|
|
cd build/release && $(MAKE)
|
|
|
|
|
2016-08-26 13:50:03 -06:00
|
|
|
release-test:
|
2014-12-01 11:00:22 -07:00
|
|
|
mkdir -p build/release
|
2016-08-26 13:50:03 -06:00
|
|
|
cd build/release && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE) && $(MAKE) test
|
2014-03-03 15:07:58 -07:00
|
|
|
|
2015-01-27 00:43:15 -07:00
|
|
|
release-all:
|
2014-12-01 11:00:22 -07:00
|
|
|
mkdir -p build/release
|
2018-04-19 04:38:46 -06:00
|
|
|
cd build/release && cmake -D BUILD_TESTS=OFF -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE)
|
2014-03-03 15:07:58 -07:00
|
|
|
|
2017-02-18 09:30:29 -07:00
|
|
|
release-static:
|
|
|
|
mkdir -p build/release
|
|
|
|
cd build/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release ../.. && $(MAKE)
|
|
|
|
|
2016-08-29 12:23:57 -06:00
|
|
|
coverage:
|
|
|
|
mkdir -p build/debug
|
|
|
|
cd build/debug && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Debug -D COVERAGE=ON ../.. && $(MAKE) && $(MAKE) test
|
|
|
|
|
2017-02-18 09:30:29 -07:00
|
|
|
# Targets for specific prebuilt builds which will be advertised for updates by their build tag
|
|
|
|
|
|
|
|
release-static-linux-armv6:
|
2016-08-27 23:44:33 -06:00
|
|
|
mkdir -p build/release
|
2017-02-18 09:30:29 -07:00
|
|
|
cd build/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv6zk" -D STATIC=ON -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="linux-armv6" ../.. && $(MAKE)
|
2016-08-27 23:44:33 -06:00
|
|
|
|
2017-02-18 09:30:29 -07:00
|
|
|
release-static-linux-armv7:
|
2016-08-27 23:44:33 -06:00
|
|
|
mkdir -p build/release
|
2017-02-18 09:30:29 -07:00
|
|
|
cd build/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv7-a" -D STATIC=ON -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="linux-armv7" ../.. && $(MAKE)
|
2016-08-29 04:13:55 -06:00
|
|
|
|
2017-01-04 18:11:05 -07:00
|
|
|
release-static-android:
|
|
|
|
mkdir -p build/release
|
2017-02-23 21:21:32 -07:00
|
|
|
cd build/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv7-a" -D STATIC=ON -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D INSTALL_VENDORED_LIBUNBOUND=ON -D BUILD_TAG="android" ../.. && $(MAKE)
|
2017-01-04 18:11:05 -07:00
|
|
|
|
2017-02-18 09:30:29 -07:00
|
|
|
release-static-linux-armv8:
|
2016-08-29 04:13:55 -06:00
|
|
|
mkdir -p build/release
|
2017-02-18 09:30:29 -07:00
|
|
|
cd build/release && cmake -D BUILD_TESTS=OFF -D ARCH="armv8-a" -D STATIC=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="linux-armv8" ../.. && $(MAKE)
|
2016-08-29 04:13:55 -06:00
|
|
|
|
2017-02-18 09:30:29 -07:00
|
|
|
release-static-linux-x86_64:
|
|
|
|
mkdir -p build/release
|
2018-04-19 04:38:46 -06:00
|
|
|
cd build/release && cmake -D BUILD_TESTS=OFF STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="linux-x64" ../.. && $(MAKE)
|
2015-04-06 05:05:30 -06:00
|
|
|
|
2017-02-18 09:30:29 -07:00
|
|
|
release-static-freebsd-x86_64:
|
2015-04-06 05:05:30 -06:00
|
|
|
mkdir -p build/release
|
2017-02-18 09:30:29 -07:00
|
|
|
cd build/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="freebsd-x64" ../.. && $(MAKE)
|
|
|
|
|
2017-02-21 03:25:58 -07:00
|
|
|
release-static-mac-x86_64:
|
2017-02-18 09:30:29 -07:00
|
|
|
mkdir -p build/release
|
|
|
|
cd build/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="mac-x64" ../.. && $(MAKE)
|
2015-04-06 05:05:30 -06:00
|
|
|
|
2017-02-18 09:30:29 -07:00
|
|
|
release-static-linux-i686:
|
2015-04-06 05:05:30 -06:00
|
|
|
mkdir -p build/release
|
2017-02-18 09:30:29 -07:00
|
|
|
cd build/release && cmake -D STATIC=ON -D ARCH="i686" -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="linux-x86" ../.. && $(MAKE)
|
2015-04-06 05:05:30 -06:00
|
|
|
|
|
|
|
release-static-win64:
|
|
|
|
mkdir -p build/release
|
2017-02-18 09:30:29 -07:00
|
|
|
cd build/release && cmake -G "MSYS Makefiles" -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="win-x64" -D CMAKE_TOOLCHAIN_FILE=../../cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=c:/msys64 ../.. && $(MAKE)
|
2015-04-06 05:05:30 -06:00
|
|
|
|
|
|
|
release-static-win32:
|
2014-09-15 00:13:26 -06:00
|
|
|
mkdir -p build/release
|
2017-02-18 09:30:29 -07:00
|
|
|
cd build/release && cmake -G "MSYS Makefiles" -D STATIC=ON -D ARCH="i686" -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=Release -D BUILD_TAG="win-x32" -D CMAKE_TOOLCHAIN_FILE=../../cmake/32-bit-toolchain.cmake -D MSYS2_FOLDER=c:/msys32 ../.. && $(MAKE)
|
2014-09-15 00:13:26 -06:00
|
|
|
|
Add fuzz testing using american fuzzy lop
Existing tests: block, transaction, signature, cold outputs,
cold transaction.
Data for these is in tests/data/fuzz.
A convenience shell script is in contrib/fuzz_testing/fuzz.sh, eg:
contrib/fuzz_testing/fuzz.sh signature
The fuzzer will run indefinitely, ^C to stop.
Fuzzing is currently supported for GCC only. I can't get CLANG
to build Monero here as it dies on some system headers, so if
someone wants to make it work on both, that'd be great.
In particular, the __AFL_LOOP construct should be made to work
so that a given run can fuzz multiple inputs, as the C++ load
time is substantial.
2017-06-24 05:38:41 -06:00
|
|
|
fuzz:
|
|
|
|
mkdir -p build/fuzz
|
2017-12-10 04:25:12 -07:00
|
|
|
cd build/fuzz && cmake -D STATIC=ON -D SANITIZE=ON -D BUILD_TESTS=ON -D USE_LTO=OFF -D CMAKE_C_COMPILER=afl-gcc -D CMAKE_CXX_COMPILER=afl-g++ -D ARCH="x86-64" -D CMAKE_BUILD_TYPE=fuzz -D BUILD_TAG="linux-x64" ../.. && $(MAKE)
|
Add fuzz testing using american fuzzy lop
Existing tests: block, transaction, signature, cold outputs,
cold transaction.
Data for these is in tests/data/fuzz.
A convenience shell script is in contrib/fuzz_testing/fuzz.sh, eg:
contrib/fuzz_testing/fuzz.sh signature
The fuzzer will run indefinitely, ^C to stop.
Fuzzing is currently supported for GCC only. I can't get CLANG
to build Monero here as it dies on some system headers, so if
someone wants to make it work on both, that'd be great.
In particular, the __AFL_LOOP construct should be made to work
so that a given run can fuzz multiple inputs, as the C++ load
time is substantial.
2017-06-24 05:38:41 -06:00
|
|
|
|
2014-03-03 15:07:58 -07:00
|
|
|
clean:
|
2014-04-30 11:07:00 -06:00
|
|
|
@echo "WARNING: Back-up your wallet if it exists within ./build!" ; \
|
|
|
|
read -r -p "This will destroy the build directory, continue (y/N)?: " CONTINUE; \
|
|
|
|
[ $$CONTINUE = "y" ] || [ $$CONTINUE = "Y" ] || (echo "Exiting."; exit 1;)
|
2014-03-03 15:07:58 -07:00
|
|
|
rm -rf build
|
|
|
|
|
|
|
|
tags:
|
|
|
|
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest
|
|
|
|
|
2015-01-27 00:43:15 -07:00
|
|
|
.PHONY: all cmake-debug debug debug-test debug-all cmake-release release release-test release-all clean tags
|