Skip to content

Commit

Permalink
Merge pull request #2975 from djdv/makefile-win-fix
Browse files Browse the repository at this point in the history
Build: Fix Makefile on Windows
  • Loading branch information
whyrusleeping committed Jul 18, 2016
2 parents 8fbbd7f + 228c4db commit 0e4c195
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ else
go_test=IPFS_REUSEPORT=false go test
endif

ifeq ($(OS),Windows_NT)
GOPATH_DELIMITER = ;
else
GOPATH_DELIMITER = :
endif

dist_root=/ipfs/QmXZQzBAFuoELw3NtjQZHkWSdA332PyQUj6pQjuhEukvg8
gx_bin=bin/gx-v0.7.0
Expand Down Expand Up @@ -41,7 +46,7 @@ bin/gx-go-v%:
gx_check: ${gx_bin} ${gx-go_bin}

path_check:
@bin/check_go_path $(realpath $(shell pwd)) $(realpath $(GOPATH)/src/github.com/ipfs/go-ipfs)
@bin/check_go_path $(realpath $(shell pwd)) $(realpath $(addsuffix /src/github.com/ipfs/go-ipfs,$(subst $(GOPATH_DELIMITER), ,$(GOPATH))))

deps: go_check gx_check path_check
${gx_bin} --verbose install --global
Expand Down
16 changes: 10 additions & 6 deletions bin/check_go_path
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

PWD=$1
EXPECTED=$2

if [ -z "$PWD" ]; then
echo "must pass in your current working directory"
Expand All @@ -13,8 +12,13 @@ if [ -z "$GOPATH" ]; then
exit 1
fi

if [ "$PWD" != "$EXPECTED" ]; then
echo "go-ipfs must be built from within your \$GOPATH directory."
echo "expected '$EXPECTED' but got '$PWD'"
exit 1
fi
while [ ${#} -gt 1 ]; do
if [ "$PWD" = "$2" ]; then
exit 0
fi
shift
done

echo "go-ipfs must be built from within your \$GOPATH directory."
echo "expected within '$GOPATH' but got '$PWD'"
exit 1

0 comments on commit 0e4c195

Please sign in to comment.