summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2013-05-23 16:51:55 -0400
committerPaul Moore <pmoore@redhat.com>2013-05-29 14:46:02 -0400
commitc0d9fc5950fb28adae649b71938368915db31908 (patch)
tree8b5a6f6f364d3fdeeaf95e5065f77f6751888e8b
parent2408afa7c975216378a254eacacb86925068f77e (diff)
downloadlibseccomp-c0d9fc5950fb28adae649b71938368915db31908.tar.gz
build: install the scmp_sys_resolver tool
Signed-off-by: Paul Moore <pmoore@redhat.com>
-rw-r--r--Makefile2
-rw-r--r--macros.mk9
-rw-r--r--tools/Makefile8
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
@@ -175,6 +175,15 @@ INSTALL_LIB_MACRO += \
(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)}')" \
" ($(INSTALL_LIB_DIR)/pkgconfig)";
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)