Lines Matching +full:- +full:h

1 #   honggfuzz - Makefile
2 # -----------------------------------------
6 # Copyright 2010-2015 by Google Inc. All Rights Reserved.
12 # http://www.apache.org/licenses/LICENSE-2.0
27 HFUZZ_CC_BIN := hfuzz_cc/hfuzz-cc
28 HFUZZ_CC_SRCS := hfuzz_cc/hfuzz-cc.c
29 COMMON_CFLAGS := -D_GNU_SOURCE -Wall -Werror -Wno-format-truncation -I.
30 COMMON_LDFLAGS := -lm libhfcommon/libhfcommon.a
32 CFLAGS ?= -O3 -mtune=native
34 LIBS_CFLAGS ?= -fPIC -fno-stack-protector
37 OS ?= $(shell uname -s)
38 MARCH ?= $(shell uname -m)
39 KERNEL ?= $(shell uname -r)
44 ARCH_CFLAGS := -std=c11 -I/usr/local/include \
45 -Wextra -Wno-override-init \
46 -funroll-loops \
47 -D_FILE_OFFSET_BITS=64
48 ARCH_LDFLAGS := -L/usr/local/include \
49 -pthread -lunwind-ptrace -lunwind-generic -lbfd -lopcodes -lrt -ldl
51 LIBS_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
53 ifeq ("$(wildcard /usr/include/bfd.h)","")
54 WARN_LIBRARY += binutils-devel
56 ifeq ("$(wildcard /usr/include/libunwind-ptrace.h)","")
57 WARN_LIBRARY += libunwind-devel/libunwind8-devel
59 ifeq ("$(wildcard /usr/local/include/intel-pt.h)","/usr/local/include/intel-pt.h")
60 ARCH_CFLAGS += -D_HF_LINUX_INTEL_PT_LIB
61 ARCH_CFLAGS += -I/usr/local/include
62 ARCH_LDFLAGS += -L/usr/local/lib -lipt -Wl,--rpath=/usr/local/lib
64 ifeq ("$(wildcard /usr/include/intel-pt.h)","/usr/include/intel-pt.h")
65 ARCH_CFLAGS += -D_HF_LINUX_INTEL_PT_LIB
66 ARCH_LDFLAGS += -lipt
69 $(info --------------------------------------------------------)
73 $(info --------------------------------------------------------)
79 # MacOS-X grep seem to use colors unconditionally
80 GREP_COLOR = --color=never
84 OS_VERSION := $(shell sw_vers -productVersion)
105 OSX_SDK_VERSION := $(shell xcrun --show-sdk-version)
107 SDK_V := $(shell xcrun --sdk $(SDK_NAME) --show-sdk-path 2>/dev/null)
109 SDK := $(shell xcrun --sdk $(SDK_NAME) --show-sdk-path 2>/dev/null)
111 CC := $(shell xcrun --sdk $(SDK_NAME) --find cc)
112 LD := $(shell xcrun --sdk $(SDK_NAME) --find cc)
113 ARCH_CFLAGS := -arch x86_64 -std=c99 -isysroot $(SDK) \
114 -x objective-c -pedantic -fblocks \
115 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized \
116 -Wreturn-type -Wpointer-arith -Wno-gnu-case-range -Wno-gnu-designator \
117 -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-attributes \
118 -Wno-embedded-directive
119 …ARCH_LDFLAGS := -F/System/Library/PrivateFrameworks -framework CoreSymbolication -framework IOKit \
120-F$(SDK_V)/System/Library/Frameworks -F$(SDK_V)/System/Library/PrivateFrameworks \
121 -F$(SDK)/System/Library/Frameworks \
122 -framework Foundation -framework ApplicationServices -framework Symbolication \
123-framework CoreServices -framework CrashReporterSupport -framework CoreFoundation \
124 -framework CommerceKit $(CRASH_REPORT)
126 XCODE_VER := $(shell xcodebuild -version | grep $(GREP_COLOR) "^Xcode" | cut -d " " -f2)
128 ARCH_LDFLAGS += -F/Applications/Xcode.app/Contents/SharedFrameworks \
129 -framework CoreSymbolicationDT \
130 -Wl,-rpath,/Applications/Xcode.app/Contents/SharedFrameworks
133 …MIG_RET := $(shell mig -header mac/mach_exc.h -user mac/mach_excUser.c -sheader mac/mach_excServer…
134-server mac/mach_excServer.c $(SDK)/usr/include/mach/mach_exc.defs &>/dev/null; echo $$?)
144 ARCH_CFLAGS := -std=c11 -I/usr/local/include -I/usr/pkg/include \
145 -Wextra -Wno-override-init \
146 -funroll-loops -D_KERNTYPES
147 ARCH_LDFLAGS := -L/usr/local/lib -L/usr/pkg/lib \
148 -pthread -lcapstone -lrt \
149 -Wl,--rpath=/usr/pkg/lib
156 ARCH_CFLAGS := -std=c11 -I/usr/local/include \
157 -Wextra -Wno-initializer-overrides -Wno-override-init \
158 -Wno-unknown-warning-option -Wno-unknown-pragmas \
159 -funroll-loops
160 ARCH_LDFLAGS := -pthread -L/usr/local/lib
165 COMPILER = $(shell $(CC) -v 2>&1 | \
166 grep $(GREP_COLOR) -oE '((gcc|clang) version|LLVM version.*clang)' | \
167 grep $(GREP_COLOR) -oE '(clang|gcc)' | head -n1)
169 ARCH_CFLAGS += -Wno-initializer-overrides -Wno-unknown-warning-option
170 ARCH_CFLAGS += -Wno-gnu-empty-initializer -Wno-format-pedantic
171 ARCH_CFLAGS += -Wno-gnu-statement-expression
172 CFLAGS_BLOCKS = -fblocks
175 ARCH_LDFLAGS += -lBlocksRuntime
196 CFLAGS += $(COMMON_CFLAGS) $(ARCH_CFLAGS) -D_HF_ARCH_${ARCH}
200 CFLAGS += -g -ggdb
201 LDFLAGS += -g -ggdb
205 ANDROID_API ?= android-26
208 ANDROID_APP_ABI ?= armeabi-v7a
216 # By default ndk-build cleans all project files to ensure that no semi-completed
218 # purposed to be used with android-all rule where we want recursive invocations
227 ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),armeabi armeabi-v7a))
228 ANDROID_NDK_TOOLCHAIN ?= arm-linux-androideabi-clang
231 ANDROID_NDK_TOOLCHAIN ?= x86-clang
233 else ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),arm64-v8a))
234 ANDROID_NDK_TOOLCHAIN ?= aarch64-linux-android-clang
237 ANDROID_NDK_TOOLCHAIN ?= x86_64-clang
244 ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),armeabi armeabi-v7a))
245 ANDROID_NDK_TOOLCHAIN ?= arm-linux-androideabi-4.9
248 ANDROID_NDK_TOOLCHAIN ?= x86-4.9
250 else ifeq ($(ANDROID_APP_ABI),$(filter $(ANDROID_APP_ABI),arm64-v8a))
251 ANDROID_NDK_TOOLCHAIN ?= aarch64-linux-android-4.9
254 ANDROID_NDK_TOOLCHAIN ?= x86_64-4.9
262 DIRS := . $(shell find $(SUBDIR_ROOTS) -type d)
278 $(CC) -c $(CFLAGS) $(CFLAGS_BLOCKS) -o $@ $<
281 $(CC) -fPIC -shared $(CFLAGS) -o $@ $<
284 $(CC) -fPIC -shared $(CFLAGS) -o $@ $<
287 $(LD) -o $(BIN) $(OBJS) $(LDFLAGS)
290 $(LD) -o $@ $(HFUZZ_CC_SRCS) $(LDFLAGS) $(CFLAGS) $(CFLAGS_BLOCKS) -D_HFUZZ_INC_PATH=$(HFUZZ_INC)
293 $(CC) -c $(CFLAGS) $(LIBS_CFLAGS) -o $@ $(@:.o=.c)
299 $(CC) -c $(CFLAGS) $(LIBS_CFLAGS) -o $@ $(@:.o=.c)
305 $(CC) -c $(CFLAGS) $(LIBS_CFLAGS) -o $@ $(@:.o=.c)
312 $(RM) -r $(CLEAN_TARGETS)
316-format -style="{BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 100, AlignAfterOpenBracket: Do…
320 makedepend -Y. -Y* -- *.c */*.c
327 @ANDROID_API=$(ANDROID_API) third_party/android/scripts/compile-libunwind.sh \
330 @ANDROID_API=$(ANDROID_API) third_party/android/scripts/compile-capstone.sh \
334 @ANDROID_API=$(ANDROID_API) third_party/android/scripts/compile-libBlocksRuntime.sh \
338 ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./android/Android.mk \
343 # Loop all ABIs and pass-through flags since visibility is lost due to sub-process
344 .PHONY: android-all
345 android-all:
350 @for abi in armeabi armeabi-v7a arm64-v8a x86 x86_64; do \
358 .PHONY: android-clean-deps
359 android-clean-deps:
361 make -C "third_party/android/capstone" clean; \
362 rm -rf "third_party/android/capstone/$$cpu"; \
363 make -C "third_party/android/libunwind" clean; \
364 rm -rf "third_party/android/libunwind/$$cpu"; \
365 ndk-build -C "third_party/android/libBlocksRuntime" \
367 rm -rf "third_party/android/libBlocksRuntime/$$cpu"; \
374 mkdir -p -m 755 $${DESTDIR}$(BIN_PATH)
375 install -m 755 honggfuzz $${DESTDIR}$(BIN_PATH)
376 install -m 755 hfuzz_cc/hfuzz-cc $${DESTDIR}$(BIN_PATH)
377 install -m 755 hfuzz_cc/hfuzz-clang $${DESTDIR}$(BIN_PATH)
378 install -m 755 hfuzz_cc/hfuzz-clang++ $${DESTDIR}$(BIN_PATH)
379 install -m 755 hfuzz_cc/hfuzz-gcc $${DESTDIR}$(BIN_PATH)
380 install -m 755 hfuzz_cc/hfuzz-g++ $${DESTDIR}$(BIN_PATH)
384 cmdline.o: cmdline.h honggfuzz.h libhfcommon/util.h libhfcommon/common.h
385 cmdline.o: display.h libhfcommon/files.h libhfcommon/common.h
386 cmdline.o: libhfcommon/log.h
387 display.o: display.h honggfuzz.h libhfcommon/util.h libhfcommon/common.h
388 display.o: libhfcommon/log.h
389 fuzz.o: fuzz.h honggfuzz.h libhfcommon/util.h arch.h input.h
390 fuzz.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
391 fuzz.o: libhfcommon/log.h mangle.h report.h sanitizers.h socketfuzzer.h
392 fuzz.o: subproc.h
393 honggfuzz.o: cmdline.h honggfuzz.h libhfcommon/util.h libhfcommon/common.h
394 honggfuzz.o: display.h fuzz.h input.h libhfcommon/files.h
395 honggfuzz.o: libhfcommon/common.h libhfcommon/log.h socketfuzzer.h subproc.h
396 input.o: input.h honggfuzz.h libhfcommon/util.h libhfcommon/common.h
397 input.o: libhfcommon/files.h libhfcommon/common.h mangle.h subproc.h
398 input.o: libhfcommon/log.h
399 mangle.o: mangle.h honggfuzz.h libhfcommon/util.h input.h
400 mangle.o: libhfcommon/common.h libhfcommon/log.h
401 report.o: report.h honggfuzz.h libhfcommon/util.h libhfcommon/common.h
402 report.o: libhfcommon/log.h
403 sanitizers.o: sanitizers.h honggfuzz.h libhfcommon/util.h cmdline.h
404 sanitizers.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
405 sanitizers.o: libhfcommon/log.h
406 socketfuzzer.o: honggfuzz.h libhfcommon/util.h libhfcommon/common.h
407 socketfuzzer.o: libhfcommon/files.h libhfcommon/common.h libhfcommon/log.h
408 socketfuzzer.o: libhfcommon/ns.h socketfuzzer.h
409 subproc.o: subproc.h honggfuzz.h libhfcommon/util.h arch.h fuzz.h
410 subproc.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
411 subproc.o: libhfcommon/log.h
412 hfuzz_cc/hfuzz-cc.o: honggfuzz.h libhfcommon/util.h libhfcommon/common.h
413 hfuzz_cc/hfuzz-cc.o: libhfcommon/files.h libhfcommon/common.h
414 hfuzz_cc/hfuzz-cc.o: libhfcommon/log.h
415 libhfcommon/files.o: libhfcommon/files.h libhfcommon/common.h
416 libhfcommon/files.o: libhfcommon/common.h libhfcommon/log.h
417 libhfcommon/files.o: libhfcommon/util.h
418 libhfcommon/log.o: libhfcommon/log.h libhfcommon/common.h libhfcommon/util.h
419 libhfcommon/ns.o: libhfcommon/ns.h libhfcommon/common.h libhfcommon/files.h
420 libhfcommon/ns.o: libhfcommon/common.h libhfcommon/log.h
421 libhfcommon/util.o: libhfcommon/util.h libhfcommon/common.h
422 libhfcommon/util.o: libhfcommon/files.h libhfcommon/common.h
423 libhfcommon/util.o: libhfcommon/log.h
424 libhfnetdriver/netdriver.o: libhfnetdriver/netdriver.h honggfuzz.h
425 libhfnetdriver/netdriver.o: libhfcommon/util.h libhfcommon/common.h
426 libhfnetdriver/netdriver.o: libhfcommon/files.h libhfcommon/common.h
427 libhfnetdriver/netdriver.o: libhfcommon/log.h libhfcommon/ns.h
428 libhfuzz/fetch.o: libhfuzz/fetch.h honggfuzz.h libhfcommon/util.h
429 libhfuzz/fetch.o: libhfcommon/common.h libhfcommon/files.h
430 libhfuzz/fetch.o: libhfcommon/common.h libhfcommon/log.h
431 libhfuzz/instrument.o: libhfuzz/instrument.h honggfuzz.h libhfcommon/util.h
432 libhfuzz/instrument.o: libhfcommon/common.h libhfcommon/log.h
433 libhfuzz/linux.o: libhfcommon/common.h libhfcommon/files.h
434 libhfuzz/linux.o: libhfcommon/common.h libhfcommon/log.h libhfcommon/ns.h
435 libhfuzz/linux.o: libhfuzz/libhfuzz.h
436 libhfuzz/memorycmp.o: libhfcommon/common.h libhfuzz/instrument.h
437 libhfuzz/persistent.o: libhfuzz/libhfuzz.h honggfuzz.h libhfcommon/util.h
438 libhfuzz/persistent.o: libhfcommon/common.h libhfcommon/files.h
439 libhfuzz/persistent.o: libhfcommon/common.h libhfcommon/log.h
440 libhfuzz/persistent.o: libhfuzz/fetch.h libhfuzz/instrument.h
441 linux/arch.o: arch.h honggfuzz.h libhfcommon/util.h fuzz.h
442 linux/arch.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
443 linux/arch.o: libhfcommon/log.h libhfcommon/ns.h linux/perf.h linux/trace.h
444 linux/arch.o: sanitizers.h subproc.h
445 linux/bfd.o: linux/bfd.h linux/unwind.h honggfuzz.h libhfcommon/util.h
446 linux/bfd.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
447 linux/bfd.o: libhfcommon/log.h
448 linux/perf.o: linux/perf.h honggfuzz.h libhfcommon/util.h
449 linux/perf.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
450 linux/perf.o: libhfcommon/log.h linux/pt.h
451 linux/pt.o: libhfcommon/common.h libhfcommon/log.h libhfcommon/util.h
452 linux/pt.o: linux/pt.h honggfuzz.h
453 linux/trace.o: linux/trace.h honggfuzz.h libhfcommon/util.h
454 linux/trace.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
455 linux/trace.o: libhfcommon/log.h linux/bfd.h linux/unwind.h sanitizers.h
456 linux/trace.o: socketfuzzer.h subproc.h
457 linux/unwind.o: linux/unwind.h honggfuzz.h libhfcommon/util.h
458 linux/unwind.o: libhfcommon/common.h libhfcommon/log.h
459 mac/arch.o: arch.h honggfuzz.h libhfcommon/util.h fuzz.h libhfcommon/common.h
460 mac/arch.o: libhfcommon/files.h libhfcommon/common.h libhfcommon/log.h
461 mac/arch.o: subproc.h
462 netbsd/arch.o: arch.h honggfuzz.h libhfcommon/util.h fuzz.h
463 netbsd/arch.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
464 netbsd/arch.o: libhfcommon/log.h libhfcommon/ns.h netbsd/trace.h subproc.h
465 netbsd/trace.o: netbsd/trace.h honggfuzz.h libhfcommon/util.h
466 netbsd/trace.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
467 netbsd/trace.o: libhfcommon/log.h netbsd/unwind.h socketfuzzer.h subproc.h
468 netbsd/unwind.o: netbsd/unwind.h honggfuzz.h libhfcommon/util.h
469 netbsd/unwind.o: libhfcommon/common.h libhfcommon/log.h
470 posix/arch.o: arch.h honggfuzz.h libhfcommon/util.h fuzz.h
471 posix/arch.o: libhfcommon/common.h libhfcommon/files.h libhfcommon/common.h
472 posix/arch.o: libhfcommon/log.h subproc.h