summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-09-05 20:29:43 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-09-05 20:29:43 -0600
commita7535d8ca8a3f3ed6ed6293e3380e2b1f0d888d8 (patch)
treef8f1271720a9fa1e41aa36157822687a1e8d7b61 /Makefile
parentd49388e2eb90b954e8cccb68c59d8fd8a55bf7a3 (diff)
Teach the Makefile to not be confused by text editor temporary files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f1e8783..031a775 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,8 @@ CGO_ENABLED = 1
export CGO_ENABLED
cgo_variables = CGO_ENABLED CGO_CFLAGS CGO_CPPFLAGS CGO_CXXFLAGS CGO_LDFLAGS CC CXX
+goext = c s S cc cpp cxx h hh hpp hxx
+gosrc = $(shell find -L src -name '.*' -prune -o \( -type f \( $(foreach e,$(goext), -name '*.$e' ) \) -o -type d \) -print)
GOPATH := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
@@ -52,7 +54,7 @@ uninstall:
$(foreach d,$(deps),$(eval src/$d: $(NET); GOPATH='$(GOPATH)' go get -d -u $d))
.PHONY: NET
-bin/nshd: $(download) $(generate) $(shell find src -name .git -prune -o -print) $(addprefix .Makefile.var.,$(cgo_variables))
+bin/nshd: $(download) $(generate) $(gosrc) $(addprefix .Makefile.var.,$(cgo_variables))
@true $(foreach f,$(filter $(vp),$^), && test $@ -nt $f ) || rm -rf -- bin pkg
GOPATH='$(GOPATH)' CGO_CFLAGS='$(CGO_CFLAGS)' go install nshd