Files
abireport/Makefile.gobuild
T
Anselmo L. S. Melo 535e714f4f build: Generate position independent executable
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.
2019-09-04 12:25:14 -07:00

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)