@cryptotaxi247 / kubo / commits / 31421aeac

Refactor Makefile.

Move the go commands that should run under cmd/ipfs in the Makefile in cmd/ipfs rather than doing a "cd cmd/ipfs && go ..." in the root Makefile. The "cd cmd/ipfs && go ..." lines causes problems with GNU Emacs's compilation mode. With the current setup Emacs is unable to jump to the location of the error outputted by go compiler as it can not find the source file. The problem is that the embedded "cd" command causes Emacs's compilation mode to lose track of the current directory and thus attempts to look for the source file in the wrong directory. License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>

Kevin Atkinson committed Apr 28, 2016 at 01:28 UTC 31421aeacedaad1379ee9d217fd5079963ab82ad
2 files changed +20 -13
Makefile
+5 -10
@@ -5,11 +5,6 @@ else
5 go_test=go test
6 endif
7
8 -COMMIT := $(shell git rev-parse --short HEAD)
9 -ldflags = "-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(COMMIT)"
10 -MAKEFLAGS += --no-print-directory
11 -
12 -
8 export IPFS_API ?= v04x.ipfs.io
9
10 all: help
@@ -45,19 +40,19 @@ vendor: godep
40 godep save -r ./...
41
42 install: deps
48 - cd cmd/ipfs && go install -ldflags=$(ldflags)
43 + make -C cmd/ipfs install
44
45 build: deps
51 - cd cmd/ipfs && go build -i -ldflags=$(ldflags)
46 + make -C cmd/ipfs build
47
48 nofuse: deps
54 - cd cmd/ipfs && go install -tags nofuse -ldflags=$(ldflags)
49 + make -C cmd/ipfs nofuse
50
51 clean:
57 - cd cmd/ipfs && go clean -ldflags=$(ldflags)
52 + make -C cmd/ipfs clean
53
54 uninstall:
60 - cd cmd/ipfs && go clean -i -ldflags=$(ldflags)
55 + make -C cmd/ipfs uninstall
56
57 PHONY += all help godep toolkit_upgrade gx_upgrade gxgo_upgrade gx_check
58 PHONY += go_check deps vendor install build nofuse clean uninstall
cmd/ipfs/Makefile
+15 -3
@@ -1,7 +1,19 @@
1 +COMMIT := $(shell git rev-parse --short HEAD)
2 +ldflags = "-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(COMMIT)"
3 +
4 all: install
5
6 +install:
7 + go install -ldflags=$(ldflags)
8 +
9 build:
4 - cd ../../ && make build
10 + go build -i -ldflags=$(ldflags)
11
6 -install:
7 - cd ../../ && make install
12 +nofuse:
13 + go install -tags nofuse -ldflags=$(ldflags)
14 +
15 +clean:
16 + go clean -ldflags=$(ldflags)
17 +
18 +uninstall:
19 + go clean -i -ldflags=$(ldflags)