Files
totp/Makefile
ryantate13 79a7235d78 Add subfolder in cmd so go install creates correct binary name (#42)
* updates to main landing page (#31)

* refine README (#29)

* dependabot target branch to dev (#30)

* Bump goreleaser/goreleaser-action from 3 to 4 (#35)

Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 3 to 4.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](https://github.com/goreleaser/goreleaser-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Merge dev to main (#39)

* refine README (#29)

* dependabot target branch to dev (#30)

* Bump github.com/spf13/cobra from 1.5.0 to 1.6.1 (#28)

Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.5.0 to 1.6.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.5.0...v1.6.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build with go 1.19.x (#32)

* support for arm64 (apple silicon chips) (#33)

* updates to main landing page (#31)

* refine README (#29)

* dependabot target branch to dev (#30)

* support for apple silicon chips

Co-authored-by: Ricky Pike <arcanericky@gmail.com>

* enable darwin/arm64 in releases (#36)

* Bump github.com/pquerna/otp from 1.3.0 to 1.4.0 (#34)

Bumps [github.com/pquerna/otp](https://github.com/pquerna/otp) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/pquerna/otp/releases)
- [Commits](https://github.com/pquerna/otp/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/pquerna/otp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump goreleaser/goreleaser-action from 3 to 4 (#35)

Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 3 to 4.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](https://github.com/goreleaser/goreleaser-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* bump Go to 1.20.x (#40)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yury Brigadirenko <ybrigo@gmail.com>

* add totp subdirectory in cmd to make go install totp@latest work

* clean up duplicate make targets

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Ricky Pike <arcanericky@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yury Brigadirenko <ybrigo@gmail.com>
Co-authored-by: Ryan Tate <ryan@yalo.com>
2023-03-23 10:20:42 -05:00

48 lines
1.2 KiB
Makefile

VERSION=1.0.0-incubation
VERSION_INJECT=github.com/arcanericky/totp/cmd.versionText
SRCS=*.go cmd/**/*.go commands/*.go
MAIN=./cmd/...
EXECUTABLE=bin/totp
LINUX=$(EXECUTABLE)-linux
DARWIN=$(EXECUTABLE)-darwin
WINDOWS=$(EXECUTABLE)-windows
LINUX_AMD64=$(LINUX)-amd64
DARWIN_AMD64=$(DARWIN)-amd64
DARWIN_ARM64=$(DARWIN)-arm64
WINDOWS_AMD64=$(WINDOWS)-amd64.exe
LINUX_386=$(LINUX)-386
WINDOWS_386=$(WINDOWS)-386.exe
LINUX_ARM32=$(LINUX)-arm
LINUX_ARM64=$(LINUX)-arm64
all: linux-amd64 windows-amd64 darwin-amd64 darwin-arm64 linux-arm linux-arm64
linux-amd64: $(LINUX_AMD64)
windows-amd64: $(WINDOWS_AMD64)
darwin-amd64: $(DARWIN_AMD64)
darwin-arm64: $(DARWIN_ARM64)
linux-arm: $(LINUX_ARM32)
linux-arm64: $(LINUX_ARM64)
test:
go test -race -coverprofile=coverage.txt -covermode=atomic . ./commands
go tool cover -html=coverage.txt -o coverage.html
$(LINUX_AMD64) $(DARWIN_AMD64) $(DARWIN_ARM64) $(LINUX_ARM32) $(LINUX_ARM64) $(WINDOWS_AMD64): $(SRCS)
$(eval GOOS := $(shell echo $@ | awk -F - '{print $$2}'))
$(eval GOARCH := $(shell echo $@ | awk -F - '{print $$3}' | sed 's/.exe//'))
$(eval LDFLAGS := "-X $(VERSION_INJECT)=$(shell sh scripts/get-version.sh)")
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $@ -ldflags $(LDFLAGS) $(MAIN)
clean:
rm -rf bin