mirror of
https://github.com/containers/skopeo.git
synced 2025-07-06 19:29:18 +00:00
Clean up and fix minor bugs in DEBUG/GOGCFLAGS handling
* Use “override GOGCFLAGS+=” so that (make GOGCFLAGS=… DEBUG=1) does not ignore the appending to GOGCFLAGS * Move quoting of -gcflags from the variable to its use, so that (make GOGCFLAGS=… DEBUG=1) is correctly quoted * Now that GOGCFLAGS and DEBUG are both handled correctly when completely empty, simplify by dropping the DEBUG!=1 branch. * Beautify the command line by not using DEBUG= if DEBUG is unset.
This commit is contained in:
parent
2c90120ce6
commit
406ab86104
9
Makefile
9
Makefile
@ -10,10 +10,7 @@ MANINSTALLDIR=${PREFIX}/share/man
|
||||
GO_MD2MAN ?= /usr/bin/go-md2man
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
GOGCFLAGS += "-N -l"
|
||||
else
|
||||
GOGCFLAGS ?= ""
|
||||
DEBUG ?= 0
|
||||
override GOGCFLAGS += -N -l
|
||||
endif
|
||||
|
||||
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
||||
@ -44,11 +41,11 @@ all: binary docs
|
||||
binary: cmd/skopeo
|
||||
docker build ${DOCKER_BUILD_ARGS} -f Dockerfile.build -t skopeobuildimage .
|
||||
docker run --rm -v ${PWD}:/src/github.com/projectatomic/skopeo \
|
||||
skopeobuildimage make binary-local DEBUG=$(DEBUG)
|
||||
skopeobuildimage make binary-local $(if $(DEBUG),DEBUG=$(DEBUG))
|
||||
|
||||
# Build w/o using Docker containers
|
||||
binary-local:
|
||||
go build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -gcflags $(GOGCFLAGS) -o skopeo ./cmd/skopeo
|
||||
go build -ldflags "-X main.gitCommit=${GIT_COMMIT}" -gcflags "$(GOGCFLAGS)" -o skopeo ./cmd/skopeo
|
||||
|
||||
|
||||
build-container:
|
||||
|
Loading…
Reference in New Issue
Block a user