mirror of
https://github.com/clearlinux/abireport.git
synced 2026-08-27 10:38:08 +00:00
535e714f4f
Add buildmode=pie flag to the build. By making binaries position independent and address randomization, it makes it harder for those using exploits that rely on known offsets, for example. This also aligns with what Clear Linux has been doing since the upgrade to gcc 9, which enables PIE by default.
29 lines
667 B
Makefile
29 lines
667 B
Makefile
CUR_DIR = $(shell pwd)
|
|
|
|
# "Normal" static binary
|
|
%.statbin:
|
|
GOPATH=$(CUR_DIR) go install -v --buildmode=pie $(subst .statbin,,$@)
|
|
|
|
clean:
|
|
test ! -d $(CUR_DIR)/pkg || rm -rvf $(CUR_DIR)/pkg; \
|
|
test ! -d $(CUR_DIR)/bin || rm -rvf $(CUR_DIR)/bin
|
|
|
|
spellcheck:
|
|
@ ( \
|
|
misspell -error `find $(CUR_DIR) -not -path '*/vendor/*' -name '*.go'`; \
|
|
);
|
|
|
|
%.compliant: spellcheck
|
|
@ ( \
|
|
pushd "$(PROJECT_ROOT)/$(subst .compliant,,$@)" >/dev/null || exit 1; \
|
|
go fmt || exit 1; \
|
|
gofmt -s -w *.go || exit 1; \
|
|
GOPATH=$(CUR_DIR)/ golint || exit 1; \
|
|
GOPATH=$(CUR_DIR)/ go vet || exit 1; \
|
|
);
|
|
|
|
%.test:
|
|
GOPATH=$(CUR_DIR) go test $(subst .test,,$@)
|
|
|
|
check: $(GO_TESTS)
|