fleet/server/mdm/scep/Makefile
Jahziel Villasana-Espinoza 272ce3187f
feat: move scep dependency inside the monorepo (#16988)
Following the pattern set up by Martin and Lucas for similar PRs. Can be
reviewed by commits:

1. move scep directory into monorepo
2. update import paths
3. update go.mod, go.sum
4. fix golint errors in scep package
5. skip a failing test that's been broken for a while
6. fix that failing test

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Manual QA for all new/changed functionality

Also verified that our test suite runs the `scep` tests.
2024-02-22 13:13:46 -05:00

52 lines
1.3 KiB
Makefile

VERSION=$(shell git describe --tags --always --dirty)
LDFLAGS=-ldflags "-X main.version=$(VERSION)"
OSARCH=$(shell go env GOHOSTOS)-$(shell go env GOHOSTARCH)
SCEPCLIENT=\
scepclient-linux-amd64 \
scepclient-linux-arm \
scepclient-darwin-amd64 \
scepclient-darwin-arm64 \
scepclient-freebsd-amd64 \
scepclient-windows-amd64.exe
SCEPSERVER=\
scepserver-linux-amd64 \
scepserver-linux-arm \
scepserver-darwin-amd64 \
scepserver-darwin-arm64 \
scepserver-freebsd-amd64 \
scepserver-windows-amd64.exe
my: scepclient-$(OSARCH) scepserver-$(OSARCH)
docker: scepclient-linux-amd64 scepserver-linux-amd64
$(SCEPCLIENT):
GOOS=$(word 2,$(subst -, ,$@)) GOARCH=$(word 3,$(subst -, ,$(subst .exe,,$@))) go build $(LDFLAGS) -o $@ ./cmd/scepclient
$(SCEPSERVER):
GOOS=$(word 2,$(subst -, ,$@)) GOARCH=$(word 3,$(subst -, ,$(subst .exe,,$@))) go build $(LDFLAGS) -o $@ ./cmd/scepserver
%-$(VERSION).zip: %.exe
rm -f $@
zip $@ $<
%-$(VERSION).zip: %
rm -f $@
zip $@ $<
release: $(foreach bin,$(SCEPCLIENT) $(SCEPSERVER),$(subst .exe,,$(bin))-$(VERSION).zip)
clean:
rm -f scepclient-* scepserver-*
test:
go test -cover ./...
# don't run race tests by default. see https://github.com/etcd-io/bbolt/issues/187
test-race:
go test -cover -race ./...
.PHONY: my docker $(SCEPCLIENT) $(SCEPSERVER) release clean test test-race