blob: f9fc5f03f09812972cb6d7c64d7e060d113b191a [file] [log] [blame]
robert.swiecki3bb518c2010-10-14 00:48:24 +00001# honggfuzz - Makefile
2# -----------------------------------------
3#
4# Author: Robert Swiecki <swiecki@google.com>
5#
robert.swiecki@gmail.comba85c3e2015-02-02 14:55:16 +00006# Copyright 2010-2015 by Google Inc. All Rights Reserved.
robert.swiecki3bb518c2010-10-14 00:48:24 +00007#
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
Aaron Carreras0903ae42016-10-14 13:25:55 -040019#
20# NOTE: xcrun is within xcode...xcode is required on OSX.
21#
robert.swiecki3bb518c2010-10-14 00:48:24 +000022
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030023# Common for all architectures
Robert Swieckia9db9dd2016-03-09 16:29:37 +010024CC ?= gcc
25LD = $(CC)
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030026BIN := honggfuzz
Robert Swieckifc35c5e2016-03-09 17:18:48 +010027COMMON_CFLAGS := -D_GNU_SOURCE -Wall -Werror -Wframe-larger-than=131072
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030028COMMON_LDFLAGS := -lm
Robert Swiecki0e673882016-03-31 18:50:29 +020029COMMON_SRCS := honggfuzz.c cmdline.c display.c files.c fuzz.c log.c mangle.c report.c sancov.c subproc.c util.c
Jaggera443b692016-08-29 23:01:15 +020030CFLAGS ?= -O3
31LDFLAGS ?=
groebert@google.com1bd4c212013-06-19 11:13:56 +000032
robert.swiecki@gmail.com448d2812015-02-02 20:57:13 +000033OS ?= $(shell uname -s)
robert.swiecki@gmail.com15eca6f2015-03-04 03:31:36 +000034MARCH ?= $(shell uname -m)
groebert@google.com1bd4c212013-06-19 11:13:56 +000035
robert.swiecki3bb518c2010-10-14 00:48:24 +000036ifeq ($(OS),Linux)
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030037 ARCH := LINUX
Robert Swieckiac310a82016-02-22 18:58:36 +010038
Robert Swiecki94d54ff2016-09-06 14:38:21 +020039 ARCH_CFLAGS := -std=c11 -I/usr/local/include -I/usr/include \
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030040 -Wextra -Wno-initializer-overrides -Wno-override-init \
Robert Swiecki0a7ce042016-08-25 15:31:31 +020041 -Wno-unknown-warning-option -funroll-loops \
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030042 -D_FILE_OFFSET_BITS=64
Jagger2e06f562016-02-11 09:32:39 +010043 ARCH_LDFLAGS := -L/usr/local/include -L/usr/include \
Jaggere4df0702016-09-11 19:19:34 +020044 -lpthread -lunwind-ptrace -lunwind-generic -lbfd -lopcodes -lrt
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030045 ARCH_SRCS := $(wildcard linux/*.c)
robert.swiecki@gmail.com3ad0bb32015-03-04 17:19:13 +000046
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030047 ifeq ("$(wildcard /usr/include/bfd.h)","")
48 WARN_LIBRARY += binutils-devel
49 endif
50 ifeq ("$(wildcard /usr/include/libunwind-ptrace.h)","")
51 WARN_LIBRARY += libunwind-devel/libunwind8-devel
52 endif
Jagger9797ac52016-02-04 23:57:29 +010053 ifeq ("$(wildcard /usr/local/include/intel-pt.h)","/usr/local/include/intel-pt.h")
54 ARCH_CFLAGS += -D_HF_LINUX_INTEL_PT_LIB
55 ARCH_CFLAGS += -I/usr/local/include
Jagger070b2c62016-02-05 06:01:15 +010056 ARCH_LDFLAGS += -L/usr/local/lib -lipt -Wl,--rpath=/usr/local/lib
Jagger9797ac52016-02-04 23:57:29 +010057 endif
Jagger919cf2b2016-09-07 20:43:33 +020058 ifeq ($(MARCH),$(filter $(MARCH),x86_64 i386))
59 # Support for popcnt (used in libhfuzz)
60 ARCH_CFLAGS += -msse4.2
61 endif
Jagger9797ac52016-02-04 23:57:29 +010062 ifeq ("$(wildcard /usr/include/intel-pt.h)","/usr/include/intel-pt.h")
63 ARCH_CFLAGS += -D_HF_LINUX_INTEL_PT_LIB
Jagger3594cda2016-02-08 00:05:47 +010064 ARCH_LDFLAGS += -lipt
Jagger9797ac52016-02-04 23:57:29 +010065 endif
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030066 ifdef WARN_LIBRARY
67 $(info ***************************************************************)
68 $(info Development libraries which are most likely missing on your OS:)
69 $(info $(WARN_LIBRARY))
70 $(info ***************************************************************)
71 endif
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030072 # OS Linux
73else ifeq ($(OS),Darwin)
74 ARCH := DARWIN
Aaron Carrerasbfd365f2016-10-16 09:22:19 -040075
76 # Figure out which crash reporter to use.
Anestis Bechtsoudis0e5c2c52015-10-08 13:30:03 -070077 CRASHWRANGLER := third_party/mac
Aaron Carreras623f4eb2016-10-15 07:52:13 -040078 OS_VERSION := $(shell sw_vers -productVersion)
Anestis Bechtsoudise3df5912016-10-28 10:02:29 +030079 ifneq (,$(findstring 10.12,$(OS_VERSION)))
80 CRASH_REPORT := $(CRASHWRANGLER)/CrashReport_Yosemite.o
Aaron Carreras623f4eb2016-10-15 07:52:13 -040081 else ifneq (,$(findstring 10.11,$(OS_VERSION)))
82 # El Capitan didn't break compatibility
83 CRASH_REPORT := $(CRASHWRANGLER)/CrashReport_Yosemite.o
84 else ifneq (,$(findstring 10.10,$(OS_VERSION)))
85 CRASH_REPORT := $(CRASHWRANGLER)/CrashReport_Yosemite.o
86 else ifneq (,$(findstring 10.9,$(OS_VERSION)))
87 CRASH_REPORT := $(CRASHWRANGLER)/CrashReport_Mavericks.o
88 else ifneq (,$(findstring 10.8,$(OS_VERSION)))
89 CRASH_REPORT := $(CRASHWRANGLER)/CrashReport_Mountain_Lion.o
90 else
91 $(error Unsupported MAC OS X version)
92 endif
93
Aaron Carrerasbfd365f2016-10-16 09:22:19 -040094 # Figure out which XCode SDK to use.
95 OSX_SDK_VERSION := $(shell xcrun --show-sdk-version)
Anestis Bechtsoudisb4425022016-10-17 12:58:01 +030096 SDK_NAME :=macosx$(OSX_SDK_VERSION)
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +030097 SDK := $(shell xcrun --sdk $(SDK_NAME) --show-sdk-path 2>/dev/null)
98 ifeq (,$(findstring MacOSX.platform,$(SDK)))
99 XC_PATH := $(shell xcode-select -p)
100 $(error $(SDK_NAME) not found in $(XC_PATH))
101 endif
Aaron Carrerasbfd365f2016-10-16 09:22:19 -0400102
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300103 CC := $(shell xcrun --sdk $(SDK_NAME) --find cc)
104 LD := $(shell xcrun --sdk $(SDK_NAME) --find cc)
Robert Swiecki0a7ce042016-08-25 15:31:31 +0200105 ARCH_CFLAGS := -arch x86_64 -std=c99 -isysroot $(SDK) -I. \
Robert Swieckia9db9dd2016-03-09 16:29:37 +0100106 -x objective-c -pedantic -fblocks \
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300107 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized \
108 -Wreturn-type -Wpointer-arith -Wno-gnu-case-range -Wno-gnu-designator \
109 -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-attributes
110 ARCH_LDFLAGS := -F/System/Library/PrivateFrameworks -framework CoreSymbolication -framework IOKit \
111 -F$(SDK)/System/Library/Frameworks -F$(SDK)/System/Library/PrivateFrameworks \
112 -framework Foundation -framework ApplicationServices -framework Symbolication \
113 -framework CoreServices -framework CrashReporterSupport -framework CoreFoundation \
114 -framework CommerceKit $(CRASH_REPORT)
115 MIG_RET := $(shell mig -header mac/mach_exc.h -user mac/mach_excUser.c -sheader mac/mach_excServer.h \
116 -server mac/mach_excServer.c $(SDK)/usr/include/mach/mach_exc.defs &>/dev/null; echo $$?)
117 ifeq ($(MIG_RET),1)
118 $(error mig failed to generate RPC code)
119 endif
120 ARCH_SRCS := $(wildcard mac/*.c)
121 # OS Darwin
tlogic@gmail.com479f0f92015-04-15 18:03:16 +0000122else
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300123 ARCH := POSIX
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300124 ARCH_SRCS := $(wildcard posix/*.c)
Robert Swiecki94d54ff2016-09-06 14:38:21 +0200125 ARCH_CFLAGS := -std=c11 -I/usr/local/include -I/usr/include \
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300126 -Wextra -Wno-initializer-overrides -Wno-override-init \
Robert Swieckiac310a82016-02-22 18:58:36 +0100127 -Wno-unknown-warning-option -Wno-unknown-pragmas \
Robert Swiecki0a7ce042016-08-25 15:31:31 +0200128 -U__STRICT_ANSI__ -funroll-loops
Jaggerf159a152016-09-02 02:22:09 +0200129 ARCH_LDFLAGS := -lpthread -L/usr/local/include -L/usr/include -lrt
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300130 # OS Posix
tlogic@gmail.com479f0f92015-04-15 18:03:16 +0000131endif
robert.swiecki@gmail.comb0cac5b2015-02-17 00:19:59 +0000132
Jagger98561502016-03-10 00:01:08 +0100133COMPILER = $(shell $(CC) -v 2>&1 | grep -E '(gcc|clang) version' | grep -oE '(clang|gcc)')
134ifeq ($(COMPILER),clang)
135 ARCH_CFLAGS += -fblocks
136 ARCH_LDFLAGS += -lBlocksRuntime
137endif
138
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300139SRCS := $(COMMON_SRCS) $(ARCH_SRCS)
140OBJS := $(SRCS:.c=.o)
Jaggera72ac9d2016-04-01 23:48:12 +0200141
Jaggerefeb4be2016-09-06 02:41:51 +0200142LIBS_SRCS := $(wildcard libhfuzz/*.c)
Jaggera72ac9d2016-04-01 23:48:12 +0200143LIBS_OBJS := $(LIBS_SRCS:.c=.o)
Jaggerefeb4be2016-09-06 02:41:51 +0200144HFUZZ_ARCH := libhfuzz/libhfuzz.a
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300145
146# Respect external user defines
147CFLAGS += $(COMMON_CFLAGS) $(ARCH_CFLAGS) -D_HF_ARCH_${ARCH}
148LDFLAGS += $(COMMON_LDFLAGS) $(ARCH_LDFLAGS)
robert.swiecki3bb518c2010-10-14 00:48:24 +0000149
Anestis Bechtsoudis3485c732015-09-10 17:40:04 +0300150ifeq ($(DEBUG),true)
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300151 CFLAGS += -g -ggdb
Robert Swieckicaf9d762016-03-10 16:13:18 +0100152 LDFLAGS += -g -ggdb
Anestis Bechtsoudis3485c732015-09-10 17:40:04 +0300153endif
154
Anestis Bechtsoudiscfc39fb2015-08-06 10:31:36 +0300155# Control Android builds
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300156ANDROID_API ?= android-24
Anestis Bechtsoudiscfc39fb2015-08-06 10:31:36 +0300157ANDROID_DEBUG_ENABLED ?= false
Anestis Bechtsoudisd1fccd52016-05-06 13:11:27 +0300158ANDROID_CLANG ?= false
Anestis Bechtsoudiscfc39fb2015-08-06 10:31:36 +0300159ANDROID_APP_ABI ?= armeabi-v7a
Anestis Bechtsoudisf5ded932016-10-18 10:50:00 +0300160ANDROID_SKIP_CLEAN ?= false
Anestis Bechtsoudiscfc39fb2015-08-06 10:31:36 +0300161NDK_BUILD_ARGS :=
Anestis Bechtsoudisf5ded932016-10-18 10:50:00 +0300162
Anestis Bechtsoudiscfc39fb2015-08-06 10:31:36 +0300163ifeq ($(ANDROID_DEBUG_ENABLED),true)
Anestis Bechtsoudisf5ded932016-10-18 10:50:00 +0300164 NDK_BUILD_ARGS += V=1 NDK_DEBUG=1 APP_OPTIM=debug
165endif
166
167# By default ndk-build cleans all project files to ensure that no semi-completed
168# builds reach the app package. The following flag disables this check. It's mainly
169# purposed to be used with android-all rule where we want recursive invocations
170# to keep previous targets' binaries.
171ifeq ($(ANDROID_SKIP_CLEAN),true)
172 NDK_BUILD_ARGS += NDK_APP.local.cleaned_binaries=true
Anestis Bechtsoudiscfc39fb2015-08-06 10:31:36 +0300173endif
174
Anestis Bechtsoudisd1fccd52016-05-06 13:11:27 +0300175ifeq ($(ANDROID_CLANG),true)
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300176 # clang works only against APIs >= 23
177 ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),armeabi armeabi-v7a))
Anestis Bechtsoudisf0179252016-09-06 12:11:05 +0300178 ANDROID_NDK_TOOLCHAIN ?= arm-linux-androideabi-clang
Anestis Bechtsoudisb4446a82016-10-28 11:30:10 +0300179 ANDROID_ARCH_CPU := arm
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300180 else ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),x86))
Jaggerd18ba372016-09-04 19:03:46 +0200181 ANDROID_NDK_TOOLCHAIN ?= x86-clang
Anestis Bechtsoudisb4446a82016-10-28 11:30:10 +0300182 ANDROID_ARCH_CPU := x86
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300183 else ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),arm64-v8a))
Jaggerd18ba372016-09-04 19:03:46 +0200184 ANDROID_NDK_TOOLCHAIN ?= aarch64-linux-android-clang
Anestis Bechtsoudisb4446a82016-10-28 11:30:10 +0300185 ANDROID_ARCH_CPU := arm64
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300186 else ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),x86_64))
Jaggerd18ba372016-09-04 19:03:46 +0200187 ANDROID_NDK_TOOLCHAIN ?= x86_64-clang
Anestis Bechtsoudisb4446a82016-10-28 11:30:10 +0300188 ANDROID_ARCH_CPU := x86_64
Anestis Bechtsoudisd1fccd52016-05-06 13:11:27 +0300189 else
190 $(error Unsuported / Unknown APP_API '$(ANDROID_APP_ABI)')
191 endif
192else
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300193 ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),armeabi armeabi-v7a))
194 ANDROID_NDK_TOOLCHAIN ?= arm-linux-androideabi-4.9
Anestis Bechtsoudisb4446a82016-10-28 11:30:10 +0300195 ANDROID_ARCH_CPU := arm
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300196 else ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),x86))
197 ANDROID_NDK_TOOLCHAIN ?= x86-4.9
Anestis Bechtsoudisb4446a82016-10-28 11:30:10 +0300198 ANDROID_ARCH_CPU := x86
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300199 else ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),arm64-v8a))
200 ANDROID_NDK_TOOLCHAIN ?= aarch64-linux-android-4.9
Anestis Bechtsoudisb4446a82016-10-28 11:30:10 +0300201 ANDROID_ARCH_CPU := arm64
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300202 else ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),x86_64))
203 ANDROID_NDK_TOOLCHAIN ?= x86_64-4.9
Anestis Bechtsoudisb4446a82016-10-28 11:30:10 +0300204 ANDROID_ARCH_CPU := x86_64
Anestis Bechtsoudis6a938ed2016-10-12 12:04:34 +0300205 else
206 $(error Unsuported / Unknown APP_API '$(ANDROID_APP_ABI)')
207 endif
Anestis Bechtsoudisd1fccd52016-05-06 13:11:27 +0300208endif
209
Jagger3cf97962016-09-06 03:17:59 +0200210SUBDIR_ROOTS := linux mac posix libhfuzz
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300211DIRS := . $(shell find $(SUBDIR_ROOTS) -type d)
212CLEAN_PATTERNS := *.o *~ core *.a *.dSYM *.la *.so *.dylib
213SUBDIR_GARBAGE := $(foreach DIR,$(DIRS),$(addprefix $(DIR)/,$(CLEAN_PATTERNS)))
214MAC_GARGBAGE := $(wildcard mac/mach_exc*)
215ANDROID_GARBAGE := obj libs
216
Jagger9a135bb2016-08-21 21:37:06 +0200217all: $(BIN) $(HFUZZ_ARCH)
robert.swiecki@gmail.comf7610522015-02-16 10:52:02 +0000218
robert.swiecki661d83a2015-03-12 14:27:51 +0000219%.o: %.c
robert.swiecki@gmail.com2a32b512015-03-10 16:06:43 +0000220 $(CC) -c $(CFLAGS) -o $@ $<
robert.swiecki@gmail.comf7610522015-02-16 10:52:02 +0000221
robert.swiecki661d83a2015-03-12 14:27:51 +0000222%.so: %.c
223 $(CC) -fPIC -shared $(CFLAGS) -o $@ $<
224
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300225%.dylib: %.c
226 $(CC) -fPIC -shared $(CFLAGS) -o $@ $<
robert.swiecki@gmail.comc5f5be62015-02-15 17:17:21 +0000227
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300228$(BIN): $(OBJS)
229 $(LD) -o $(BIN) $(OBJS) $(LDFLAGS)
groebert@google.com1bd4c212013-06-19 11:13:56 +0000230
Jaggerc0dce052016-09-11 15:46:39 +0200231$(LIBS_OBJS): $(LIBS_SRCS)
Jagger418d3502016-09-12 15:17:14 +0200232 $(CC) -c -fPIC -fno-builtin $(CFLAGS) -fno-stack-protector -o $@ $(@:.o=.c)
Jaggerc0dce052016-09-11 15:46:39 +0200233
Jagger9a135bb2016-08-21 21:37:06 +0200234$(HFUZZ_ARCH): $(LIBS_OBJS)
235 $(AR) rcs $(HFUZZ_ARCH) $(LIBS_OBJS)
236
Robert Swiecki1cd09ae2016-02-10 15:56:48 +0100237.PHONY: clean
robert.swiecki3bb518c2010-10-14 00:48:24 +0000238clean:
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300239 $(RM) -r core $(OBJS) $(BIN) $(MAC_GARGBAGE) $(ANDROID_GARBAGE) $(SUBDIR_GARBAGE)
robert.swiecki3bb518c2010-10-14 00:48:24 +0000240
Robert Swiecki1cd09ae2016-02-10 15:56:48 +0100241.PHONY: indent
robert.swiecki3bb518c2010-10-14 00:48:24 +0000242indent:
Jagger400fd8f2015-08-16 10:50:55 +0200243 indent -linux -l100 -lc100 -nut -i4 *.c *.h */*.c */*.h; rm -f *~ */*~
robert.swiecki@gmail.comcc050fd2015-02-02 20:00:42 +0000244
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300245.PHONY: depend
robert.swiecki@gmail.comcc050fd2015-02-02 20:00:42 +0000246depend:
Jagger59c0d0e2016-09-11 15:56:47 +0200247 makedepend -Y. -Y* -- *.c */*.c
Anestis Bechtsoudis057c99f2015-09-24 14:39:57 +0300248
249.PHONY: android
Anestis Bechtsoudisc1f6faa2015-07-31 05:32:19 +0300250android:
Anestis Bechtsoudisb4446a82016-10-28 11:30:10 +0300251 @ANDROID_API=$(ANDROID_API) third_party/android/scripts/compile-libunwind.sh \
252 third_party/android/libunwind $(ANDROID_ARCH_CPU)
253
254 @ANDROID_API=$(ANDROID_API) third_party/android/scripts/compile-capstone.sh \
255 third_party/android/capstone $(ANDROID_ARCH_CPU)
256
257 ifeq ($(ANDROID_CLANG),true)
258 @ANDROID_API=$(ANDROID_API) third_party/android/scripts/compile-libBlocksRuntime.sh \
259 third_party/android/libBlocksRuntime $(ANDROID_ARCH_CPU)
260 endif
261
Anestis Bechtsoudis3b5bd872015-09-13 10:58:30 +0300262 ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./android/Android.mk \
Anestis Bechtsoudisf5ded932016-10-18 10:50:00 +0300263 APP_PLATFORM=$(ANDROID_API) APP_ABI=$(ANDROID_APP_ABI) \
264 NDK_TOOLCHAIN=$(ANDROID_NDK_TOOLCHAIN) $(NDK_BUILD_ARGS)
265
266# Loop all ABIs and pass-through flags since visibility is lost due to sub-process
267.PHONY: android-all
268android-all:
269 @echo "Cleaning workspace:"
270 $(MAKE) clean
271 @echo ""
272
273 @for abi in armeabi armeabi-v7a arm64-v8a x86 x86_64; do \
274 ANDROID_APP_ABI=$$abi ANDROID_SKIP_CLEAN=true ANDROID_CLANG=$(ANDROID_CLANG) \
275 ANDROID_API=$(ANDROID_API) ANDROID_DEBUG_ENABLED=$(ANDROID_DEBUG_ENABLED) \
276 $(MAKE) android || { \
277 echo "Recursive make failed"; exit 1; }; \
278 echo ""; \
279 done
Anestis Bechtsoudisb42f3e02015-08-17 08:57:42 +0300280
Anestis Bechtsoudis6257b612016-10-28 11:30:43 +0300281.PHONY: android-clean-deps
282android-clean-deps:
283 @for cpu in arm arm64 x86 x86_64; do \
284 make -C "third_party/android/capstone" clean; \
285 rm -rf "third_party/android/capstone/$$cpu"; \
286 make -C "third_party/android/libunwind" clean; \
287 rm -rf "third_party/android/libunwind/$$cpu"; \
288 ndk-build -C "third_party/android/libBlocksRuntime" \
289 NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk clean; \
290 rm -rf "third_party/android/libBlocksRuntime/$$cpu"; \
291 done
292
robert.swiecki3bb518c2010-10-14 00:48:24 +0000293# DO NOT DELETE
robert.swiecki@gmail.comcc050fd2015-02-02 20:00:42 +0000294
Robert Swiecki8b769342016-01-21 16:35:48 +0100295cmdline.o: cmdline.h common.h log.h files.h util.h
Robert Swiecki81c6a0d2015-09-08 15:43:20 +0200296display.o: common.h display.h log.h util.h
Robert Swiecki8ca28222016-03-15 20:35:44 +0100297files.o: common.h files.h log.h util.h
Jagger08816fd2016-03-11 01:32:38 +0100298fuzz.o: common.h fuzz.h arch.h files.h log.h mangle.h report.h sancov.h
Jaggerc8b6eda2016-09-01 03:52:35 +0200299fuzz.o: subproc.h util.h
Jagger59c0d0e2016-09-11 15:56:47 +0200300honggfuzz.o: common.h cmdline.h display.h log.h files.h fuzz.h util.h
Jaggerc8b6eda2016-09-01 03:52:35 +0200301log.o: common.h log.h util.h
Jagger400fd8f2015-08-16 10:50:55 +0200302mangle.o: common.h mangle.h log.h util.h
Jagger3db1d952016-03-10 02:02:46 +0100303report.o: common.h report.h log.h util.h
Jagger733849b2016-03-10 03:19:04 +0100304sancov.o: common.h sancov.h files.h log.h util.h
Jagger2ed5b732016-09-04 17:45:59 +0200305subproc.o: common.h subproc.h arch.h files.h log.h sancov.h util.h
Jaggerc8b6eda2016-09-01 03:52:35 +0200306util.o: common.h util.h files.h log.h
Jagger561b9792016-09-12 15:14:37 +0200307libhfuzz/instrument.o: common.h util.h
308libhfuzz/memorycmp.o: libhfuzz/instrument.h
Jagger59c0d0e2016-09-11 15:56:47 +0200309libhfuzz/persistent.o: common.h
Jaggere631ee82016-09-11 15:55:34 +0200310linux/arch.o: common.h arch.h common.h files.h linux/perf.h
311linux/arch.o: linux/ptrace_utils.h log.h sancov.h subproc.h util.h
Robert Swieckie8f8e8d2016-10-03 23:51:32 +0200312linux/bfd.o: common.h linux/bfd.h linux/unwind.h files.h common.h log.h
Jagger59c0d0e2016-09-11 15:56:47 +0200313linux/bfd.o: util.h
Robert Swieckie8f8e8d2016-10-03 23:51:32 +0200314linux/perf.o: common.h linux/perf.h files.h common.h log.h util.h linux/pt.h
Jagger59c0d0e2016-09-11 15:56:47 +0200315linux/pt.o: common.h linux/pt.h log.h common.h util.h
Robert Swieckie8f8e8d2016-10-03 23:51:32 +0200316linux/ptrace_utils.o: common.h linux/ptrace_utils.h files.h common.h log.h
Jagger59c0d0e2016-09-11 15:56:47 +0200317linux/ptrace_utils.o: sancov.h subproc.h util.h linux/bfd.h linux/unwind.h
318linux/unwind.o: common.h linux/unwind.h log.h common.h
319mac/arch.o: common.h arch.h files.h log.h sancov.h subproc.h util.h
320posix/arch.o: common.h arch.h common.h files.h log.h sancov.h subproc.h
321posix/arch.o: util.h