Skip to contentSkip to conversation

Makefile: allow to install libfdt without building executables

PATCH Applied Nicolas Escande 3 participants 4 messages Jul 26, 2023 – Jul 29, 2023 2 messages not in the archive Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: allow to install libfdt without building executables

When we only need the libfdt calling the target install-lib also builds the executables listed in $(BINS) because this target depends on all Instead lets make install-lib only depend on libfdt.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 784e2f8..c0b68a2 100644
@@ -238,7 +238,7 @@ install-bin: all $(SCRIPTS)
 	$(INSTALL_PROGRAM) $(BIN) $(DESTDIR)$(BINDIR)
 	$(INSTALL_SCRIPT) $(SCRIPTS) $(DESTDIR)$(BINDIR)
 
-install-lib: all
+install-lib: libfdt
 	@$(VECHO) INSTALL-LIB
 	$(INSTALL) -d $(DESTDIR)$(LIBDIR)
 	$(INSTALL_LIB) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
Signature · 1 line
2.41.0

A message that is not in the archive (sent off-list or not yet received): 20230726144336.677135-1-nico.escande-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 9 lines · Nicolas Escande

When we only need the libfdt calling the target install-lib also builds the executables listed in $(BINS) because this target depends on all Instead lets make install-lib only depend on libfdt.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

But why would you just want the libs?

Quoted 17 lines
Makefile +1 -2
index 784e2f8..c0b68a2 100644
@@ -238,7 +238,7 @@ install-bin: all $(SCRIPTS)
        $(INSTALL_PROGRAM) $(BIN) $(DESTDIR)$(BINDIR)
        $(INSTALL_SCRIPT) $(SCRIPTS) $(DESTDIR)$(BINDIR)
 
-install-lib: all
+install-lib: libfdt
        @$(VECHO) INSTALL-LIB
        $(INSTALL) -d $(DESTDIR)$(LIBDIR)
        $(INSTALL_LIB) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
--

2.41.0

A message that is not in the archive (sent off-list or not yet received): CAPnjgZ1OZBF6YWUCrKUW1FEHaR4EzZMGVn00k62vcQSA91ubzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 6 lines · Simon Glass
Quoted 5 lines · Nicolas Escande

When we only need the libfdt calling the target install-lib also builds the executables listed in $(BINS) because this target depends on all Instead lets make install-lib only depend on libfdt.

Quoted 9 lines
Quoted 4 lines
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

But why would you just want the libs?

Well some projects like qemu & uboot from the top of my head use the libfdt and do not always need/build the dtc that goes with it.
It's cleary very corner case but I don't think it harms anyone doing so :)

Applied
#5 lore raw
In reply to a message not in the archive
Quoted 5 lines · Nicolas Escande

When we only need the libfdt calling the target install-lib also builds the executables listed in $(BINS) because this target depends on all Instead lets make install-lib only depend on libfdt.

Merged, thanks.

Quoted 17 lines
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 784e2f8..c0b68a2 100644
@@ -238,7 +238,7 @@ install-bin: all $(SCRIPTS)
 	$(INSTALL_PROGRAM) $(BIN) $(DESTDIR)$(BINDIR)
 	$(INSTALL_SCRIPT) $(SCRIPTS) $(DESTDIR)$(BINDIR)
 
-install-lib: all
+install-lib: libfdt
 	@$(VECHO) INSTALL-LIB
 	$(INSTALL) -d $(DESTDIR)$(LIBDIR)
 	$(INSTALL_LIB) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson