mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 17:03:58 +08:00
@ -11,8 +11,12 @@ DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*) $(d)/tmp
|
|||||||
PATH := $(realpath $(d)):$(PATH)
|
PATH := $(realpath $(d)):$(PATH)
|
||||||
|
|
||||||
$(TGTS_$(d)):
|
$(TGTS_$(d)):
|
||||||
rm -f $@
|
rm -f $@$(?exe)
|
||||||
|
ifeq ($(WINDOWS),1)
|
||||||
|
cp $^$(?exe) $@$(?exe)
|
||||||
|
else
|
||||||
ln -s $(notdir $^) $@
|
ln -s $(notdir $^) $@
|
||||||
|
endif
|
||||||
|
|
||||||
bin/gx-v%:
|
bin/gx-v%:
|
||||||
@echo "installing gx $(@:bin/gx-%=%)"
|
@echo "installing gx $(@:bin/gx-%=%)"
|
||||||
|
11
bin/dist_get
11
bin/dist_get
@ -57,6 +57,13 @@ unarchive() {
|
|||||||
ua_infile="$2"
|
ua_infile="$2"
|
||||||
ua_outfile="$3"
|
ua_outfile="$3"
|
||||||
ua_distname="$4"
|
ua_distname="$4"
|
||||||
|
ua_binpostfix=""
|
||||||
|
ua_os=$(uname -o)
|
||||||
|
|
||||||
|
if [ "$ua_os" = "Msys" ] || [ "$ua_os" = "Cygwin" ] ; then
|
||||||
|
ua_binpostfix=".exe"
|
||||||
|
fi
|
||||||
|
ua_outfile="$ua_outfile$ua_binpostfix"
|
||||||
|
|
||||||
if ! check_writeable "$ua_outfile"; then
|
if ! check_writeable "$ua_outfile"; then
|
||||||
die "unarchive error: cannot write to $ua_outfile"
|
die "unarchive error: cannot write to $ua_outfile"
|
||||||
@ -66,7 +73,7 @@ unarchive() {
|
|||||||
tar.gz)
|
tar.gz)
|
||||||
if have_binary tar; then
|
if have_binary tar; then
|
||||||
echo "==> using 'tar' to extract binary from archive"
|
echo "==> using 'tar' to extract binary from archive"
|
||||||
< "$ua_infile" tar -Ozxf - "$ua_distname/$ua_distname" > "$ua_outfile" \
|
< "$ua_infile" tar -Ozxf - "$ua_distname/$ua_distname$ua_binpostfix" > "$ua_outfile" \
|
||||||
|| die "tar has failed"
|
|| die "tar has failed"
|
||||||
else
|
else
|
||||||
die "no binary on system for extracting tar files"
|
die "no binary on system for extracting tar files"
|
||||||
@ -75,7 +82,7 @@ unarchive() {
|
|||||||
zip)
|
zip)
|
||||||
if have_binary unzip; then
|
if have_binary unzip; then
|
||||||
echo "==> using 'unzip' to extract binary from archive"
|
echo "==> using 'unzip' to extract binary from archive"
|
||||||
unzip -p "$ua_infile" "$ua_distname/$ua_distname" > "$ua_outfile" \
|
unzip -p "$ua_infile" "$ua_distname/$ua_distname$ua_binpostfix" > "$ua_outfile" \
|
||||||
|| die "unzip has failed"
|
|| die "unzip has failed"
|
||||||
else
|
else
|
||||||
die "no installed method for extracting .zip archives"
|
die "no installed method for extracting .zip archives"
|
||||||
|
Reference in New Issue
Block a user