From 50e58bdd111ae4603c30314a656f57efa9d7f16c Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 28 Feb 2019 16:32:25 +0200 Subject: radare2: refactor makefile --- misc/radare2/GNUmakefile | 35 +++++++++++++++++++++++++++++++++++ misc/radare2/Makefile | 35 ----------------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 misc/radare2/GNUmakefile delete mode 100644 misc/radare2/Makefile diff --git a/misc/radare2/GNUmakefile b/misc/radare2/GNUmakefile new file mode 100644 index 0000000..ef9e809 --- /dev/null +++ b/misc/radare2/GNUmakefile @@ -0,0 +1,35 @@ +MAKEFLAGS += --no-builtin-rules +R2_PLUGIN_PATH ?= $(shell r2 -H R2_USER_PLUGINS) + +WARNINGS := -Wall -Wextra -Wformat=2 -Wstrict-aliasing=3 -Wstrict-overflow=5 -Wstack-usage=12500 \ + -Wfloat-equal -Wcast-align -Wpointer-arith -Wchar-subscripts -Warray-bounds=2 + +override CFLAGS ?= -g -O2 $(WARNINGS) +override CFLAGS += -std=c11 +override CPPFLAGS ?= -D_FORTIFY_SOURCE=2 + +libs = asm_fspec.so anal_fspec.so +all: $(libs) + +%.so: + $(LINK.c) -fPIC -shared $(filter %.c,$^) $(LDLIBS) -o $@ + +asm_fspec.so: private CFLAGS += $(shell pkg-config --cflags r_anal) +asm_fspec.so: private LDLIBS += $(shell pkg-config --libs-only-l r_anal) +asm_fspec.so: asm_fspec.c + +anal_fspec.so: private CFLAGS += $(shell pkg-config --cflags r_anal) +anal_fspec.so: private LDLIBS += $(shell pkg-config --libs-only-l r_anal) +anal_fspec.so: anal_fspec.c + +install: $(libs) + install -Dm755 $^ -t "$(R2_PLUGIN_PATH)" + +uninstall: + $(RM) "$(R2_PLUGIN_PATH)"/asm_fspec.so + $(RM) "$(R2_PLUGIN_PATH)"/anal_fspec.so + +clean: + $(RM) $(libs) + +.PHONY: all clean install uninstall diff --git a/misc/radare2/Makefile b/misc/radare2/Makefile deleted file mode 100644 index b8fcdd2..0000000 --- a/misc/radare2/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -MAKEFLAGS += --no-builtin-rules -R2_PLUGIN_PATH ?= $(shell r2 -H R2_USER_PLUGINS) - -# GCC 7: -Wstringop-overflow=, -Walloc-size-larger-than=, -Wduplicated-{branches,cond} -WARNINGS := -Wall -Wextra -Wformat=2 -Wstrict-aliasing=3 -Wstrict-overflow=5 -Wstack-usage=12500 \ - -Wfloat-equal -Wcast-align -Wpointer-arith -Wchar-subscripts -Warray-bounds=2 - -override CFLAGS ?= -g -override CFLAGS += -std=c11 $(WARNINGS) - -libs = asm_fspec.so anal_fspec.so -all: $(libs) - -%.so: - $(LINK.c) -fPIC -shared $(filter %.c,$^) $(LDLIBS) -o $@ - -asm_fspec.so: private CFLAGS += $(shell pkg-config --cflags r_anal) -asm_fspec.so: private LDLIBS += $(shell pkg-config --libs-only-l r_anal) -asm_fspec.so: asm_fspec.c - -anal_fspec.so: private CFLAGS += $(shell pkg-config --cflags r_anal) -anal_fspec.so: private LDLIBS += $(shell pkg-config --libs-only-l r_anal) -anal_fspec.so: anal_fspec.c - -install: $(libs) - install -Dm755 $^ -t "$(R2_PLUGIN_PATH)" - -uninstall: - $(RM) "$(R2_PLUGIN_PATH)"/asm_fspec.so - $(RM) "$(R2_PLUGIN_PATH)"/anal_fspec.so - -clean: - $(RM) $(libs) - -.PHONY: all clean install uninstall -- cgit v1.2.3-70-g09d2