Skip to content

Commit

Permalink
Clean up Makefile targets
Browse files Browse the repository at this point in the history
* move echo-source and echo-database targets so the build target is first and default
* mark echo-source and echo-database targets as .PHONY
  • Loading branch information
dhui committed Aug 4, 2021
1 parent a4c42d7 commit b2c89c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ TEST_FLAGS ?=
REPO_OWNER ?= $(shell cd .. && basename "$$(pwd)")
COVERAGE_DIR ?= .coverage

echo-source:
@echo "$(SOURCE)"

echo-database:
@echo "$(DATABASE)"

build:
CGO_ENABLED=0 go build -ldflags='-X main.Version=$(VERSION)' -tags '$(DATABASE) $(SOURCE)' ./cmd/migrate

Expand Down Expand Up @@ -104,6 +98,12 @@ release:
git tag v$(V)
@read -p "Press enter to confirm and push to origin ..." && git push origin v$(V)

echo-source:
@echo "$(SOURCE)"

echo-database:
@echo "$(DATABASE)"


define external_deps
@echo '-- $(1)'; go list -f '{{join .Deps "\n"}}' $(1) | grep -v github.com/$(REPO_OWNER)/migrate | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
Expand All @@ -113,7 +113,7 @@ endef

.PHONY: build build-docker build-cli clean test-short test test-with-flags html-coverage \
restore-import-paths rewrite-import-paths list-external-deps release \
docs kill-docs open-docs kill-orphaned-docker-containers
docs kill-docs open-docs kill-orphaned-docker-containers echo-source echo-database

SHELL = /bin/sh
RAND = $(shell echo $$RANDOM)
Expand Down

0 comments on commit b2c89c7

Please sign in to comment.