mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-13 10:38:07 +00:00
add GNUmakefile
This commit is contained in:
47
examples/afl_network_proxy/GNUmakefile
Normal file
47
examples/afl_network_proxy/GNUmakefile
Normal file
@ -0,0 +1,47 @@
|
||||
PREFIX ?= /usr/local
|
||||
BIN_PATH = $(PREFIX)/bin
|
||||
DOC_PATH = $(PREFIX)/share/doc/afl
|
||||
|
||||
PROGRAMS = afl-network-client afl-network-server
|
||||
|
||||
HASH=\#
|
||||
|
||||
ifdef STATIC
|
||||
CFLAGS += -static
|
||||
endif
|
||||
|
||||
ifdef USE_DEFLATE
|
||||
CFLAGS += -ldeflate -DUSE_DEFLATE=1
|
||||
$(info activating libdeflate-dev for compressing)
|
||||
endif
|
||||
|
||||
# Disables because compression is slower
|
||||
# sending 64kb instead of compressing to 112bytes is slower? weird ...
|
||||
#ifeq "$(shell echo '$(HASH)include <libdeflate.h>@int main() { struct libdeflate_compressor *d = libdeflate_alloc_compressor(1); return 0;}' | tr @ '\n' | $(CC) $(CFLAGS) -x c - -o .test2 -ldeflate 2>/dev/null && echo 1 || echo 0 ; rm -f .test2 )" "1"
|
||||
# CFLAGS += -ldeflate -DUSE_DEFLATE=1
|
||||
# $(info libdeflate-dev was detected, using compressing)
|
||||
#else
|
||||
# $(warn did not find libdeflate-dev, cannot use compression)
|
||||
#endif
|
||||
|
||||
all: $(PROGRAMS)
|
||||
|
||||
help:
|
||||
@echo make options:
|
||||
echo STATIC - build as static binaries
|
||||
echo USE_DEFLATE - build with compression library
|
||||
|
||||
afl-network-client: afl-network-client.c
|
||||
$(CC) $(CFLAGS) -I../../include -o afl-network-client afl-network-client.c -ldeflate
|
||||
|
||||
afl-network-server: afl-network-server.c
|
||||
$(CC) $(CFLAGS) -I../../include -o afl-network-server afl-network-server.c ../../src/afl-forkserver.c ../../src/afl-sharedmem.c ../../src/afl-common.c -DBIN_PATH=\"$(BIN_PATH)\" -ldeflate
|
||||
|
||||
clean:
|
||||
rm -f $(PROGRAMS) *~ core
|
||||
|
||||
install: all
|
||||
install -d -m 755 $${DESTDIR}$(BIN_PATH) $${DESTDIR}$(DOC_PATH)
|
||||
install -m 755 $(PROGRAMS) $${DESTDIR}$(BIN_PATH)
|
||||
install -m 644 README.md $${DESTDIR}$(DOC_PATH)/README.network_proxy.md
|
||||
|
Reference in New Issue
Block a user