[CRIU] [PATCH 2/5] compel Makefiles: simplify headers [un]install

Kir Kolyshkin kir at openvz.org
Sat Mar 4 21:42:48 PST 2017


* install

'cp' can copy recursively, create directories, and even
dereference symlinks.  Everything we have in uapi/ is to be installed.

NOTE we can't use -r for compel includes, as there is some extra stuff
in there we don't want to take with us (in particular, plugins/
and 'compel -> .' symlinks).

* uninstall

rm -rf everything under compel includedir

While at it, fix some minor things here and there.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 compel/Makefile         | 13 +++----------
 compel/plugins/Makefile |  6 ++----
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/compel/Makefile b/compel/Makefile
index d09aa77..fee1212 100644
--- a/compel/Makefile
+++ b/compel/Makefile
@@ -59,10 +59,9 @@ install: compel/compel compel/$(LIBCOMPEL_SO) compel/$(LIBCOMPEL_A)
 	$(E) "  INSTALL " $(LIBCOMPEL_A)
 	$(Q) install -m 0644 compel/$(LIBCOMPEL_A) $(DESTDIR)$(LIBDIR)
 	$(E) "  INSTALL " compel uapi
-	$(Q) mkdir -p $(DESTDIR)$(LIBEXECDIR)/compel/
 	$(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)/compel/asm
-	$(Q) cp -fr compel/include/uapi/compel/*.h $(DESTDIR)$(INCLUDEDIR)/compel
-	$(Q) cp -fr compel/include/uapi/compel/asm/*.h $(DESTDIR)$(INCLUDEDIR)/compel/asm
+	$(Q) cp -fr compel/include/uapi/*.h $(DESTDIR)$(INCLUDEDIR)/compel/
+	$(Q) cp -fr compel/include/uapi/asm/*.h $(DESTDIR)$(INCLUDEDIR)/compel/asm/
 	$(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)/compel/common/asm
 	$(Q) cp -fr include/common/compiler.h $(DESTDIR)$(INCLUDEDIR)/compel/common/
 .PHONY: install
@@ -77,11 +76,5 @@ uninstall:
 	$(E) " UNINSTALL" $(LIBCOMPEL_A)
 	$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBDIR)/,$(LIBCOMPEL_A))
 	$(E) " UNINSTALL" compel uapi
-	$(Q) $(RM) $(addprefix $(DESTDIR)$(INCLUDEDIR)/,compel/*.h)
-	$(Q) $(RM) $(addprefix $(DESTDIR)$(INCLUDEDIR)/,compel/asm/*.h)
-	$(Q) $(RM) -rf $(addprefix $(DESTDIR)$(INCLUDEDIR)/,compel/asm/)
-	$(Q) $(RM) $(addprefix $(DESTDIR)$(INCLUDEDIR)/,compel/common/*.h)
-	$(Q) $(RM) $(addprefix $(DESTDIR)$(INCLUDEDIR)/,compel/common/asm/*.h)
-	$(Q) $(RM) -rf $(addprefix $(DESTDIR)$(INCLUDEDIR)/,compel/common/asm/)
-	$(Q) $(RM) -rf $(addprefix $(DESTDIR)$(INCLUDEDIR)/,compel/common/)
+	$(Q) $(RM) -rf $(addprefix $(DESTDIR)$(INCLUDEDIR)/,compel/*)
 .PHONY: uninstall
diff --git a/compel/plugins/Makefile b/compel/plugins/Makefile
index e57a963..53321aa 100644
--- a/compel/plugins/Makefile
+++ b/compel/plugins/Makefile
@@ -83,10 +83,8 @@ install: compel/plugins/std.built-in.o
 	$(Q) mkdir -p $(DESTDIR)$(LIBEXECDIR)/compel/scripts
 	$(Q) install -m 0644 compel/arch/$(ARCH)/scripts/compel-pack.lds.S $(DESTDIR)$(LIBEXECDIR)/compel/scripts
 	$(E) "  INSTALL " compel plugins uapi
-	$(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)/compel/plugins/std/asm
-	$(Q) cp -fr compel/include/uapi/compel/plugins/plugin-std.h $(DESTDIR)$(INCLUDEDIR)/compel/plugins
-	$(Q) cp -fr compel/include/uapi/compel/plugins/std/*.h $(DESTDIR)$(INCLUDEDIR)/compel/plugins/std
-	$(Q) cp -fr compel/arch/$(ARCH)/plugins/include/asm/syscall-types.h $(DESTDIR)$(INCLUDEDIR)/compel/plugins/std/asm
+	$(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)/compel/plugins
+	$(Q) cp -frL compel/plugins/include/uapi/* $(DESTDIR)$(INCLUDEDIR)/compel/plugins/
 .PHONY: install
 
 uninstall:
-- 
2.9.3



More information about the CRIU mailing list