diff mbox series

[XEN,41/57] libs: Remove need for *installlocal targets

Message ID 20211206170241.13165-42-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show
Series Toolstack build system improvement, toward non-recursive makefiles | expand

Commit Message

Anthony PERARD Dec. 6, 2021, 5:02 p.m. UTC
There is no need for an extra "installlocal" target, we can use
double-colon rules instead.

"install-headers" in "libs/store" was introduced for the same reason
that "installlocal" exist, so it is replaced as well.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/libs.mk        |  4 ++--
 tools/libs/light/Makefile | 10 ++--------
 tools/libs/store/Makefile | 10 ++--------
 3 files changed, 6 insertions(+), 18 deletions(-)

Comments

Jürgen Groß Dec. 7, 2021, 1:20 p.m. UTC | #1
On 06.12.21 18:02, Anthony PERARD wrote:
> There is no need for an extra "installlocal" target, we can use
> double-colon rules instead.

Doesn't that mean that with the ultimate goal of including all
Makefiles of the tree that all "install" and "uninstall" rules in the
tree will have to be double-colon rules? Citing from the make manual:

   When a target appears in multiple rules, all the rules must be the
   same type: all ordinary, or all double-colon.

> 
> "install-headers" in "libs/store" was introduced for the same reason
> that "installlocal" exist, so it is replaced as well.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

With above remark I don't see how tools/libs/stat/Makefile can be left
unmodified, as it includes libs.mk and it contains an "intall:" rule.


Juergen
Anthony PERARD Dec. 21, 2021, 5:59 p.m. UTC | #2
On Tue, Dec 07, 2021 at 02:20:29PM +0100, Juergen Gross wrote:
> On 06.12.21 18:02, Anthony PERARD wrote:
> > There is no need for an extra "installlocal" target, we can use
> > double-colon rules instead.
> 
> Doesn't that mean that with the ultimate goal of including all
> Makefiles of the tree that all "install" and "uninstall" rules in the
> tree will have to be double-colon rules?

So, the install targets will be double-colon but for a different reason
(because of the framework been used). All the "install" target will
actually have different name, they will be prefixed by the name of the
directory where the Makefile is.

For example, "install" in "xl" will be named "xl/install", but there
will be something that will allow to run "make -C xl install" which will
call the rule "xl/install".

> With above remark I don't see how tools/libs/stat/Makefile can be left
> unmodified, as it includes libs.mk and it contains an "intall:" rule.

I've missed that one, just because ./configure doesn't allow to enable
the binding...

Thanks,
diff mbox series

Patch

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 91d4efeaed..7f2c676be4 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -97,7 +97,7 @@  endif
 endif
 
 .PHONY: install
-install: all
+install:: all
 	$(INSTALL_DIR) $(DESTDIR)$(libdir)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
@@ -108,7 +108,7 @@  install: all
 	$(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: uninstall
-uninstall:
+uninstall::
 	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
 	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$$i; done
 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 622fa04470..5e52db9b30 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -243,17 +243,11 @@  libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 testidl: testidl.o libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ testidl.o $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(LDLIBS_libxentoolcore) $(APPEND_LDFLAGS)
 
-install: installlocal $(LIBHEADERS)
-
-.PHONY: installlocal
-installlocal: libxl-save-helper
+install:: $(LIBHEADERS) libxl-save-helper
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
 
-uninstall: uninstalllocal
-
-.PHONY: uninstalllocal
-uninstalllocal:
+uninstall::
 	rm -f $(DESTDIR)$(LIBEXEC_BIN)/libxl-save-helper
 
 clean: cleanlocal
diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
index 457122a041..1bacee6cf1 100644
--- a/tools/libs/store/Makefile
+++ b/tools/libs/store/Makefile
@@ -32,10 +32,7 @@  endif
 -include $(DEPS_INCLUDE)
 
 .PHONY: install
-install: install-headers
-
-.PHONY: install-headers
-install-headers:
+install::
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)/xenstore-compat
 	$(INSTALL_DATA) $(XEN_INCLUDE)/xenstore-compat/xs.h $(DESTDIR)$(includedir)/xenstore-compat/xs.h
@@ -44,10 +41,7 @@  install-headers:
 	ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(includedir)/xs_lib.h
 
 .PHONY: uninstall
-uninstall: uninstall-headers
-
-.PHONY: uninstall-headers
-uninstall-headers:
+uninstall::
 	rm -f $(DESTDIR)$(includedir)/xs_lib.h
 	rm -f $(DESTDIR)$(includedir)/xs.h
 	rm -f $(DESTDIR)$(includedir)/xenstore-compat/xs_lib.h