Skip to content

Commit

Permalink
Merge branch 'makefile'
Browse files Browse the repository at this point in the history
Add the ability to customize:

- GOOS (defaults to 'linux' for tini)
- GOARCH (defaults to 'amd64' for tini)
- DOCKEROPTS (for container build customization)
  • Loading branch information
synackd committed Mar 25, 2024
2 parents 929721d + 81312f8 commit 4e0bd56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@
NAME ?= bss
VERSION ?= $(shell cat .version)
BINARIES = boot-script-service bss-init
GOOS := $(if $(GOOS),$(GOOS),linux)
GOARCH := $(if $(GOARCH),$(GOARCH),amd64)


all : image unittest ct snyk ct_image

binaries: $(BINARIES)

%: cmd/%/*.go
GOOS=linux GOARCH=amd64 go build -v -tags musl $(LDFLAGS) -o $@ ./$(dir $<)
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -v -tags musl $(LDFLAGS) -o $@ ./$(dir $<)

clean:
rm -f $(BINARIES)
Expand All @@ -52,4 +54,4 @@ ct_image:
docker build --no-cache -f test/ct/Dockerfile test/ct/ --tag hms-bss-hmth-test:${VERSION}

docker: $(BINARIES)
docker build --tag openchami/bss:v$(VERSION)-dirty .
docker build --tag openchami/bss:v$(VERSION)-dirty $(DOCKEROPTS) .

0 comments on commit 4e0bd56

Please sign in to comment.