summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 688a695..1af0fcb 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,8 @@ systemddir = $(libdir)/systemd
user = nshd
group = nshd
+NET ?= NET
+
CFLAGS = -std=c99 -Wall -Wextra -Werror -pedantic
CGO_CFLAGS = $(CFLAGS) -Wno-unused-parameter
CGO_ENABLED = 1
@@ -46,7 +48,7 @@ uninstall:
rmdir -p -- $(sort $(dir $(install))) 2>/dev/null || true
.PHONY: uninstall
-$(foreach d,$(deps),$(eval src/$d: NET; GOPATH='$(GOPATH)' go get -d -u $d))
+$(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))
@@ -59,11 +61,11 @@ nshd.service: .Makefile.var.bindir .Makefile.var.user .Makefile.var.group
nshd.socket: .Makefile.var.user .Makefile.var.group
$(DESTDIR)$(bindir)/%: bin/%
- install -Dm755 $< $@
+ install -TDm755 $< $@
$(DESTDIR)$(systemddir)/system/%.socket: %.socket
- install -Dm644 $< $@
+ install -TDm644 $< $@
$(DESTDIR)$(systemddir)/system/%.service: %.service
- install -Dm644 $< $@
+ install -TDm644 $< $@
.Makefile.var.%: FORCE
@printf '%s' '$($*)' > .tmp$@ && { cmp -s .tmp$@ $@ && rm -f -- .tmp$@ || mv -Tf .tmp$@ $@; } || { rm -f -- .tmp$@; false; }