1# 2# american fuzzy lop++ - libdislocator 3# ---------------------------------- 4# 5# Originally written by Michal Zalewski 6# 7# Copyright 2016 Google Inc. All rights reserved. 8# 9# Licensed under the Apache License, Version 2.0 (the "License"); 10# you may not use this file except in compliance with the License. 11# You may obtain a copy of the License at: 12# 13# http://www.apache.org/licenses/LICENSE-2.0 14# 15 16PREFIX ?= /usr/local 17HELPER_PATH = $(PREFIX)/lib/afl 18 19VERSION = $(shell grep '^\#define VERSION ' ../../config.h | cut -d '"' -f2) 20 21CFLAGS ?= -O3 -funroll-loops -D_FORTIFY_SOURCE=2 22CFLAGS += -I ../../include/ -Wall -g -Wno-pointer-sign 23 24CFLAGS_ADD=$(USEHUGEPAGE:1=-DUSEHUGEPAGE) 25CFLAGS_ADD += $(USENAMEDPAGE:1=-DUSENAMEDPAGE) 26CFLAGS += $(CFLAGS_ADD) 27 28all: libdislocator.so 29 30libdislocator.so: libdislocator.so.c ../../config.h 31 $(CC) $(CFLAGS) $(CPPFLAGS) -shared -fPIC libdislocator.so.c -o $@ $(LDFLAGS) 32 cp -fv libdislocator.so ../../ 33 34.NOTPARALLEL: clean 35 36clean: 37 rm -f *.o *.so *~ a.out core core.[1-9][0-9]* 38 rm -f ../../libdislocator.so 39 40install: all 41 install -m 755 -d $${DESTDIR}$(HELPER_PATH) 42 install -m 755 ../../libdislocator.so $${DESTDIR}$(HELPER_PATH) 43 install -m 644 -T README.md $${DESTDIR}$(HELPER_PATH)/README.dislocator.md 44 45