Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Unverified Commit eaee2dac authored by Konrad Weihmann's avatar Konrad Weihmann Committed by Josh Boyer
Browse files

Makefile: replace mkdir by install


mkdir -p creates paths that are bound to user's settings and therefore
can lead to different file mode bits of the base paths accross different
machines.
Use install instead, as this tool is not prone to such behavior.

Signed-off-by: default avatarKonrad Weihmann <kweihmann@outlook.com>
Signed-off-by: default avatarJosh Boyer <jwboyer@kernel.org>
parent 12865e7e
No related merge requests found
...@@ -9,5 +9,5 @@ check: ...@@ -9,5 +9,5 @@ check:
@./check_whence.py @./check_whence.py
install: install:
mkdir -p $(DESTDIR)$(FIRMWAREDIR) install -d $(DESTDIR)$(FIRMWAREDIR)
./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR) ./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR)
...@@ -46,14 +46,14 @@ src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER) ...@@ -46,14 +46,14 @@ src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER)
ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/libgloss $@ ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/libgloss $@
binutils: src/binutils-$(BINUTILS_VER) binutils: src/binutils-$(BINUTILS_VER)
mkdir -p build/binutils install -d build/binutils
cd build/binutils; \ cd build/binutils; \
$(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \ $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \
$(MAKE) -j3; \ $(MAKE) -j3; \
$(MAKE) install $(MAKE) install
gcc: src/gcc-$(GCC_VER) binutils gcc: src/gcc-$(GCC_VER) binutils
mkdir -p build/gcc install -d build/gcc
cd build/gcc; \ cd build/gcc; \
$(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \ $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \
$(MAKE) -j3; \ $(MAKE) -j3; \
......
...@@ -34,7 +34,7 @@ done ...@@ -34,7 +34,7 @@ done
grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do
test -f "$f" || continue test -f "$f" || continue
$verbose "copying file $f" $verbose "copying file $f"
mkdir -p $destdir/$(dirname "$f") install -d $destdir/$(dirname "$f")
cp -d "$f" $destdir/"$f" cp -d "$f" $destdir/"$f"
done done
...@@ -42,7 +42,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d ...@@ -42,7 +42,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d
if test -L "$f"; then if test -L "$f"; then
test -f "$destdir/$f" && continue test -f "$destdir/$f" && continue
$verbose "copying link $f" $verbose "copying link $f"
mkdir -p $destdir/$(dirname "$f") install -d $destdir/$(dirname "$f")
cp -d "$f" $destdir/"$f" cp -d "$f" $destdir/"$f"
if test "x$d" != "x"; then if test "x$d" != "x"; then
...@@ -63,7 +63,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d ...@@ -63,7 +63,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d
fi fi
else else
$verbose "creating link $f -> $d" $verbose "creating link $f -> $d"
mkdir -p $destdir/$(dirname "$f") install -d $destdir/$(dirname "$f")
ln -sf "$d" "$destdir/$f" ln -sf "$d" "$destdir/$f"
fi fi
done done
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment