Skip to content

Commit 2a5f344

Browse files
Merge pull request #4682 from djdv/fix/win-make
Fix/win make
2 parents 4aaf24f + e613e9d commit 2a5f344

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

bin/Rules.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*) $(d)/tmp
1111
PATH := $(realpath $(d)):$(PATH)
1212

1313
$(TGTS_$(d)):
14-
rm -f $@
14+
rm -f $@$(?exe)
15+
ifeq ($(WINDOWS),1)
16+
cp $^$(?exe) $@$(?exe)
17+
else
1518
ln -s $(notdir $^) $@
19+
endif
1620

1721
bin/gx-v%:
1822
@echo "installing gx $(@:bin/gx-%=%)"

bin/dist_get

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ unarchive() {
5757
ua_infile="$2"
5858
ua_outfile="$3"
5959
ua_distname="$4"
60+
ua_binpostfix=""
61+
ua_os=$(uname -o)
62+
63+
if [ "$ua_os" = "Msys" ] || [ "$ua_os" = "Cygwin" ] ; then
64+
ua_binpostfix=".exe"
65+
fi
66+
ua_outfile="$ua_outfile$ua_binpostfix"
6067

6168
if ! check_writeable "$ua_outfile"; then
6269
die "unarchive error: cannot write to $ua_outfile"
@@ -66,7 +73,7 @@ unarchive() {
6673
tar.gz)
6774
if have_binary tar; then
6875
echo "==> using 'tar' to extract binary from archive"
69-
< "$ua_infile" tar -Ozxf - "$ua_distname/$ua_distname" > "$ua_outfile" \
76+
< "$ua_infile" tar -Ozxf - "$ua_distname/$ua_distname$ua_binpostfix" > "$ua_outfile" \
7077
|| die "tar has failed"
7178
else
7279
die "no binary on system for extracting tar files"
@@ -75,7 +82,7 @@ unarchive() {
7582
zip)
7683
if have_binary unzip; then
7784
echo "==> using 'unzip' to extract binary from archive"
78-
unzip -p "$ua_infile" "$ua_distname/$ua_distname" > "$ua_outfile" \
85+
unzip -p "$ua_infile" "$ua_distname/$ua_distname$ua_binpostfix" > "$ua_outfile" \
7986
|| die "unzip has failed"
8087
else
8188
die "no installed method for extracting .zip archives"

0 commit comments

Comments
 (0)