From c0d9fc5950fb28adae649b71938368915db31908 Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Thu, 23 May 2013 16:51:55 -0400 Subject: build: install the scmp_sys_resolver tool Signed-off-by: Paul Moore --- Makefile | 2 +- macros.mk | 9 +++++++++ tools/Makefile | 8 +++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 84a1fb1..4fd50c6 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ include install.mk CONFIGS = configure.mk configure.h version_info.mk libseccomp.pc SUBDIRS_BUILD = include src tests tools -SUBDIRS_INSTALL = include src doc +SUBDIRS_INSTALL = include src tools doc .PHONY: tarball install ctags cstags clean dist-clean $(SUBDIRS_BUILD) diff --git a/macros.mk b/macros.mk index f2b89cc..04789a0 100644 --- a/macros.mk +++ b/macros.mk @@ -174,6 +174,15 @@ INSTALL_LIB_MACRO += \ (cd "$(INSTALL_LIB_DIR)"; $(RM) $$basname); \ (cd "$(INSTALL_LIB_DIR)"; $(LN) -s $^ $$basename); +ifeq ($(V),0) + INSTALL_BIN_MACRO = @echo " INSTALL $^ ($(INSTALL_BIN_DIR)/$^)"; +endif +INSTALL_BIN_MACRO += \ + $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \ + -d "$(INSTALL_BIN_DIR)"; \ + $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0755 \ + "$^" "$(INSTALL_BIN_DIR)"; + ifeq ($(V),0) INSTALL_PC_MACRO = \ @echo " INSTALL $$(cat /proc/$$$$/cmdline | awk '{print $$(NF)}')" \ diff --git a/tools/Makefile b/tools/Makefile index 0d8a0ab..79c7d25 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -30,6 +30,7 @@ include ../macros.mk # include $(TOPDIR)/configure.mk +include $(TOPDIR)/install.mk LDFLAGS := ../src/libseccomp.a @@ -38,13 +39,15 @@ TOOLS = scmp_bpf_disasm \ scmp_sys_resolver \ scmp_arch_detect +TOOLS_INSTALL = scmp_sys_resolver + DEPS = $(TOOLS:%=%.d) # # targets # -.PHONY: clean +.PHONY: install clean all: $(TOOLS) @@ -56,5 +59,8 @@ $(DEPS): $(TOOLS): $(COMPILE_EXEC) +install: $(TOOLS_INSTALL) + $(INSTALL_BIN_MACRO) + clean: $(RM) $(DEPS) $(TOOLS) -- cgit v1.2.1