mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 10:57:42 +08:00
GNU Make's wildcard function does not recurse into subdirectories when passed the '**' glob, which results in adding a dependency only to .go files in the first level of subdirectories under the source root. We shell out to 'find' instead, which catches all .go files in the given directory.
59 lines
1.5 KiB
Makefile
59 lines
1.5 KiB
Makefile
|
|
BINS = bin/random bin/multihash bin/ipfs bin/pollEndpoint
|
|
IPFS_ROOT = ../
|
|
IPFS_CMD = ../cmd/ipfs
|
|
RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random
|
|
MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash
|
|
POLLENDPOINT_SRC= ../thirdparty/pollEndpoint
|
|
|
|
# User might want to override those on the command line
|
|
GOFLAGS =
|
|
|
|
all: deps
|
|
|
|
deps: bins
|
|
|
|
clean:
|
|
rm $(BINS)
|
|
|
|
bins: $(BINS)
|
|
|
|
find_go_files = $(shell find $(1) -name "*.go")
|
|
|
|
bin/random: $(call find_go_files, $(RANDOM_SRC)) IPFS-BUILD-OPTIONS
|
|
@echo "*** installing $@ ***"
|
|
go build $(GOFLAGS) -o bin/random $(RANDOM_SRC)/random
|
|
|
|
bin/multihash: $(call find_go_files, $(MULTIHASH_SRC)) IPFS-BUILD-OPTIONS
|
|
@echo "*** installing $@ ***"
|
|
go build $(GOFLAGS) -o bin/multihash $(MULTIHASH_SRC)/multihash
|
|
|
|
bin/ipfs: $(call find_go_files, $(IPFS_ROOT)) IPFS-BUILD-OPTIONS
|
|
@echo "*** installing $@ ***"
|
|
go build $(GOFLAGS) -o bin/ipfs $(IPFS_CMD)
|
|
|
|
bin/pollEndpoint: $(call find_go_files, $(POLLENDPOINT_SRC)) IPFS-BUILD-OPTIONS
|
|
@echo "*** installing $@ ***"
|
|
go build $(GOFLAGS) -o bin/pollEndpoint $(POLLENDPOINT_SRC)
|
|
|
|
test: test_expensive
|
|
|
|
test_expensive:
|
|
cd sharness && make TEST_EXPENSIVE=1
|
|
cd 3nodetest && make
|
|
cd dependencies && make
|
|
|
|
test_cheap:
|
|
cd sharness && make
|
|
cd 3nodetest && make
|
|
|
|
test_race:
|
|
cd sharness && make GOFLAGS=-race TEST_EXPENSIVE=1
|
|
cd 3nodetest && make GOFLAGS=-race
|
|
cd dependencies && make GOFLAGS=-race
|
|
|
|
IPFS-BUILD-OPTIONS: FORCE
|
|
@bin/checkflags '$@' '$(GOFLAGS)' '*** new Go flags ***'
|
|
|
|
.PHONY: all clean FORCE
|