Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 1 | From 71514e74f35f2b51ca24062573d6d913525b30db Mon Sep 17 00:00:00 2001 |
| 2 | From: Konrad Weihmann <kweihmann@outlook.com> |
| 3 | Date: Mon, 9 May 2022 12:57:57 +0200 |
| 4 | Subject: [PATCH] Makefile: replace mkdir by install |
| 5 | |
| 6 | mkdir -p creates paths that are bound to user's settings and therefore |
| 7 | can lead to different file mode bits of the base paths accross different |
| 8 | machines. |
| 9 | Use install instead, as this tool is not prone to such behavior. |
| 10 | |
| 11 | Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> |
| 12 | Upstream-Status: Submitted [https://lore.kernel.org/linux-firmware/PR2PR09MB310088EA719E6D7CA5C268F1A8C69@PR2PR09MB3100.eurprd09.prod.outlook.com/] |
| 13 | --- |
| 14 | Makefile | 2 +- |
| 15 | carl9170fw/toolchain/Makefile | 4 ++-- |
| 16 | copy-firmware.sh | 6 +++--- |
| 17 | 3 files changed, 6 insertions(+), 6 deletions(-) |
| 18 | |
| 19 | diff --git a/Makefile b/Makefile |
| 20 | index e1c362f..83a0ec6 100644 |
| 21 | --- a/Makefile |
| 22 | +++ b/Makefile |
| 23 | @@ -9,5 +9,5 @@ check: |
| 24 | @./check_whence.py |
| 25 | |
| 26 | install: |
| 27 | - mkdir -p $(DESTDIR)$(FIRMWAREDIR) |
| 28 | + install -d $(DESTDIR)$(FIRMWAREDIR) |
| 29 | ./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR) |
| 30 | diff --git a/carl9170fw/toolchain/Makefile b/carl9170fw/toolchain/Makefile |
| 31 | index 2b25ffe..aaea8e8 100644 |
| 32 | --- a/carl9170fw/toolchain/Makefile |
| 33 | +++ b/carl9170fw/toolchain/Makefile |
| 34 | @@ -46,14 +46,14 @@ src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER) |
| 35 | ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/libgloss $@ |
| 36 | |
| 37 | binutils: src/binutils-$(BINUTILS_VER) |
| 38 | - mkdir -p build/binutils |
| 39 | + install -d build/binutils |
| 40 | cd build/binutils; \ |
| 41 | $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \ |
| 42 | $(MAKE) -j3; \ |
| 43 | $(MAKE) install |
| 44 | |
| 45 | gcc: src/gcc-$(GCC_VER) binutils |
| 46 | - mkdir -p build/gcc |
| 47 | + install -d build/gcc |
| 48 | cd build/gcc; \ |
| 49 | $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \ |
| 50 | $(MAKE) -j3; \ |
| 51 | diff --git a/copy-firmware.sh b/copy-firmware.sh |
| 52 | index 9b46b63..bbacb92 100755 |
| 53 | --- a/copy-firmware.sh |
| 54 | +++ b/copy-firmware.sh |
| 55 | @@ -34,7 +34,7 @@ done |
| 56 | grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do |
| 57 | test -f "$f" || continue |
| 58 | $verbose "copying file $f" |
| 59 | - mkdir -p $destdir/$(dirname "$f") |
| 60 | + install -d $destdir/$(dirname "$f") |
| 61 | cp -d "$f" $destdir/"$f" |
| 62 | done |
| 63 | |
| 64 | @@ -42,7 +42,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d |
| 65 | if test -L "$f"; then |
| 66 | test -f "$destdir/$f" && continue |
| 67 | $verbose "copying link $f" |
| 68 | - mkdir -p $destdir/$(dirname "$f") |
| 69 | + install -d $destdir/$(dirname "$f") |
| 70 | cp -d "$f" $destdir/"$f" |
| 71 | |
| 72 | if test "x$d" != "x"; then |
| 73 | @@ -63,7 +63,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d |
| 74 | fi |
| 75 | else |
| 76 | $verbose "creating link $f -> $d" |
| 77 | - mkdir -p $destdir/$(dirname "$f") |
| 78 | + install -d $destdir/$(dirname "$f") |
| 79 | ln -sf "$d" "$destdir/$f" |
| 80 | fi |
| 81 | done |
| 82 | -- |
| 83 | 2.25.1 |
| 84 | |