summaryrefslogtreecommitdiffstats
path: root/payloads
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@coreboot.org>2021-12-08 15:48:25 +0100
committerFelix Singer <service+coreboot-gerrit@felixsinger.de>2023-12-31 18:48:32 +0000
commitee53dfd07d3b0584f734621ca88c26a6c403b3a4 (patch)
tree0a82491f2e567d923b2b195d80e7a1c34fd9f4b1 /payloads
parentde30b4b3f6caa4d0d552ef18f169672a56ab8121 (diff)
downloadcoreboot-ee53dfd07d3b0584f734621ca88c26a6c403b3a4.tar.gz
coreboot-ee53dfd07d3b0584f734621ca88c26a6c403b3a4.tar.bz2
coreboot-ee53dfd07d3b0584f734621ca88c26a6c403b3a4.zip
libpayload: Remove shell for loops in install Makefile target
They always require special care so that line breaks and variable names are escaped properly. One loop can be removed entirely because install accepts multiple files to install in a target directories, the other loops were filled by find which can just call the commands on its own. Change-Id: I9f9dddfe3f3ceceb6a0510d6dd862351e4b10210 Signed-off-by: Patrick Georgi <patrick@coreboot.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79523 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/Makefile.inc17
1 files changed, 5 insertions, 12 deletions
diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc
index c511e128554f..e4d45a644cd3 100644
--- a/payloads/libpayload/Makefile.inc
+++ b/payloads/libpayload/Makefile.inc
@@ -120,23 +120,16 @@ $(obj)/head.o: $(obj)/arch/$(ARCHDIR-y)/head.head.o.o
install: real-target
printf " INSTALL $(DESTDIR)/libpayload/lib\n"
install -m 755 -d $(DESTDIR)/libpayload/lib
- for lib in $(library-targets); do \
- install -m 644 $$lib $(DESTDIR)/libpayload/lib/; \
- done
+ install -m 644 $(library-targets) $(DESTDIR)/libpayload/lib/
install -m 644 arch/$(ARCHDIR-y)/libpayload.ldscript $(DESTDIR)/libpayload/lib/
install -m 755 -d $(DESTDIR)/libpayload/lib/$(ARCHDIR-y)
install -m 644 $(obj)/head.o $(DESTDIR)/libpayload/lib/$(ARCHDIR-y)
printf " INSTALL $(DESTDIR)/libpayload/include\n"
install -m 755 -d $(DESTDIR)/libpayload/include
- for file in `find include -name *.h -type f`; do \
- install -m 755 -d $(DESTDIR)/libpayload/`dirname $$file`; \
- install -m 644 $$file $(DESTDIR)/libpayload/$$file; \
- done
- for file in `find $(coreboottop)/src/commonlib/bsd/include -name *.h -type f`; do \
- dest_file=$$(realpath --relative-to=$(coreboottop)/src/commonlib/bsd/ $$file); \
- install -m 755 -d "$(DESTDIR)/libpayload/`dirname $$dest_file`"; \
- install -m 644 "$$file" "$(DESTDIR)/libpayload/$$dest_file"; \
- done
+ find include -type d -exec install -m755 -d $(DESTDIR)/libpayload/{} \;
+ find include -type f -exec install -m644 {} $(DESTDIR)/libpayload/{} \;
+ cd $(coreboottop)/src/commonlib/bsd && find include -type d -exec install -m755 -d $(DESTDIR)/libpayload/{} \;
+ cd $(coreboottop)/src/commonlib/bsd && find include -type f -exec install -m644 {} $(DESTDIR)/libpayload/{} \;
install -m 644 $(obj)/libpayload-config.h $(DESTDIR)/libpayload/include
$(foreach item,$(includes), \
install -m 755 -d $(DESTDIR)/libpayload/include/$(call extract_nth,2,$(item)); \