diff options
-rw-r--r-- | HACKING.md | 5 | ||||
-rw-r--r-- | Makefile | 20 | ||||
-rw-r--r-- | config.mk | 7 | ||||
-rw-r--r-- | go/.gitignore | 1 | ||||
m--------- | go/src/git.lukeshu.com/go/libnslcd | 0 | ||||
m--------- | go/src/golang.org/x/sys | 0 | ||||
m--------- | go/src/gopkg.in/yaml.v2 | 0 |
7 files changed, 17 insertions, 16 deletions
diff --git a/HACKING.md b/HACKING.md deleted file mode 100644 index 38f6775..0000000 --- a/HACKING.md +++ /dev/null @@ -1,5 +0,0 @@ -The golang.org/x/sys/unix library can't be updated past commit -ab9e364efd8b52800ff7ee48a9ffba4e0ed78dfb (where I have it right now) -until go commit 93da0b6e66f24c4c307e0df37ceb102a33306174 (currently on -master) makes it in to a release. It narrowly missed the cut-off to -be in go 1.9; I expect it to be in go 1.10 around February 2018. @@ -1,4 +1,4 @@ -# Copyright 2015-2017 Luke Shumaker <lukeshu@sbcglobal.net>. +# Copyright 2015-2018 Luke Shumaker <lukeshu@sbcglobal.net>. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -36,13 +36,11 @@ bins = $(bins_c) $(bins_go) $(bins_lib) $(bins_script) # # Go language noise -CGO_CPPFLAGS = $(CPPFLAGS) -U_FORTIFY_SOURCE -CGO_CFLAGS = $(CFLAGS) -O0 -Wno-unused-parameter -CGO_ENABLED = 1 +GOPATH = $(abspath $(topoutdir)/go) -cgo_variables = CGO_ENABLED CGO_CFLAGS CGO_CPPFLAGS CGO_CXXFLAGS CGO_LDFLAGS CC CXX -$(foreach v,$(cgo_variables),$(eval $v ?=)) -export $(cgo_variables) +go_variables := $(shell go env|cut -d= -f1) +$(foreach v,$(go_variables),$(if $(filter GO% CGO%,$v),$(eval $v ?=),$(eval go_$v ?=))) +go_env = $(foreach v,$(go_variables),$(if $(go_$v),$v='$(go_$v)',$(if $($v),$v='$($v)'))) # # Generate (pre-tarball) @@ -64,11 +62,11 @@ nested.subdirs += $(dir $(filter %/Makefile,$(_gitfiles.all))) # Build (post-tarball) files.out.all += $(addprefix bin/,$(filter-out $(bins_script),$(bins))) nshd.service nshd.sysusers -files.out.int += go/pkg/ go/bin/ go/bin/* +files.out.int += go/pkg/ go/bin/ go/cache/ go/bin/* # Go -$(addprefix %/bin/,$(bins_go)): %/src - GOPATH=$(abspath $*) go install $(bins_go) +$(addprefix %/bin/,$(bins_go)): %/src FORCE + $(go_env) go install $(bins_go) $(outdir)/bin/%: $(outdir)/go/bin/% cp -T $< $@ # C @@ -94,7 +92,7 @@ go_os_arch = $(word 4,$(shell go version)) go_race_os_arch = $(shell go help build | sed -n '/^\s*-race/,/^\s*-/p'| grep -oE '[a-z0-9]+/[a-z0-9]+') go_test_flags = $(if $(filter $(go_os_arch),$(go_race_os_arch)),-race) $(outdir)/check: - GOPATH=$$PWD/go go test $(go_test_flags) $$(GOPATH=$$PWD/go go list -f '{{.ImportPath}}{{"\n"}}{{join .Deps "\n"}}' $(bins_go) | sort -u | grep -e ^nshd -e '\.[^/]*/') + $(go_env) go test $(go_test_flags) $$($(go_env) go list -f '{{.ImportPath}}{{"\n"}}{{join .Deps "\n"}}' $(bins_go) | sort -u | grep -e ^nshd -e '\.[^/]*/') .PHONY: $(outdir)/check at.targets += $(outdir)/check @@ -12,8 +12,15 @@ shadow_file = $(sysconfdir)/nshd/shadow NET ?= #NET ?= FORCE user = nshd + +# C CFLAGS += -Wall -Wextra -Werror -pedantic CC = gcc -std=c99 .LIBPATTERNS = lib%.so lib%.a +# Go +go_CC = gcc -std=gnu99 +GOCACHE = $(topoutdir)/go/cache +CGO_ENABLED = 1 + endif diff --git a/go/.gitignore b/go/.gitignore index 4c48abf..5b5707a 100644 --- a/go/.gitignore +++ b/go/.gitignore @@ -1,2 +1,3 @@ /pkg/ /bin/ +/cache/ diff --git a/go/src/git.lukeshu.com/go/libnslcd b/go/src/git.lukeshu.com/go/libnslcd -Subproject dfe22c5b083443ed00df9431cbd3cd7a7b4fd6a +Subproject 027bcb726ea5e37d9fb3040419e9f079cdbb0ce diff --git a/go/src/golang.org/x/sys b/go/src/golang.org/x/sys -Subproject ab9e364efd8b52800ff7ee48a9ffba4e0ed78df +Subproject bb9c189858d91f42db229b04d45a4c3d23a7662 diff --git a/go/src/gopkg.in/yaml.v2 b/go/src/gopkg.in/yaml.v2 -Subproject 287cf08546ab5e7e37d55a84f7ed3fd1db036de +Subproject 5420a8b6744d3b0345ab293f6fcba19c978f118 |