makefile sanity checks
This commit is contained in:
		
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							@@ -7,6 +7,8 @@ LOCAL_JS=$(REPO)/contrib/js/nntpchan
 | 
			
		||||
VENDOR_JS=$(REPO)/contrib/js/vendor
 | 
			
		||||
SRND_DIR=$(REPO)/contrib/backends/srndv2
 | 
			
		||||
SRND=$(REPO)/srndv2
 | 
			
		||||
GOROOT=$(shell go env GOROOT)
 | 
			
		||||
GO=$(GOROOT)/bin/go
 | 
			
		||||
 | 
			
		||||
all: clean build
 | 
			
		||||
 | 
			
		||||
@@ -30,12 +32,12 @@ $(JS): js-deps
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
$(SRND):
 | 
			
		||||
	$(MAKE) -C $(SRND_DIR)
 | 
			
		||||
	GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR)
 | 
			
		||||
	cp $(SRND_DIR)/srndv2 $(SRND)
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f $(SRND) $(JS)
 | 
			
		||||
	$(MAKE) -C $(SRND_DIR) clean
 | 
			
		||||
	GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR) clean
 | 
			
		||||
 | 
			
		||||
distclean: clean
 | 
			
		||||
	rm -rf $(REPO_GOPATH)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,19 @@
 | 
			
		||||
GO ?= $(GOROOT)/bin/go
 | 
			
		||||
REPO=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 | 
			
		||||
VERSION=$(shell $(GO) version | cut -d' ' -f3)
 | 
			
		||||
 | 
			
		||||
all: srndv2
 | 
			
		||||
all: build
 | 
			
		||||
 | 
			
		||||
srndv2:
 | 
			
		||||
	GOPATH=$(REPO) go build -v
 | 
			
		||||
build: srndv2
 | 
			
		||||
 | 
			
		||||
assert-go:
 | 
			
		||||
	test $(VERSION) = go1.9
 | 
			
		||||
 | 
			
		||||
srndv2: assert-go
 | 
			
		||||
	GOPATH=$(REPO) GOROOT=$(GOROOT) $(GO) build -v
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	GOPATH=$(REPO) go clean -v
 | 
			
		||||
	GOPATH=$(REPO) GOROOT=$(GOROOT) $(GO) clean -v
 | 
			
		||||
 | 
			
		||||
test:
 | 
			
		||||
	GOPATH=$(REPO) go test -v -tags libsodium srnd
 | 
			
		||||
 | 
			
		||||
test-pure:
 | 
			
		||||
	GOPATH=$(REPO) go test -v srnd
 | 
			
		||||
	GOPATH=$(REPO) GOROOT=$(GOROOT) $(GO) test -v srnd
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user