Makefile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. VERS_MAJOR := 0
  2. VERS_MINOR := 4
  3. VERSION := $(VERS_MAJOR).$(VERS_MINOR)
  4. NEW_MINOR := $$(( $(VERS_MINOR) + 1 ))
  5. NEW_MAJOR := $$(( $(VERS_MAJOR) + 1 ))
  6. output:
  7. output/sendmail: output
  8. go build -o output/sendmail -ldflags "-X main.version=$(VERSION)" ./...
  9. output/sendmail-dev: output
  10. go build -o output/sendmail-dev ./...
  11. clean:
  12. rm output/*
  13. build: clean output/sendmail
  14. dev-build: clean output/sendmail-dev
  15. bumpvers-minor:
  16. sed -i"" "s/VERS_MINOR := $(VERS_MINOR)/VERS_MINOR := $(NEW_MINOR)/" Makefile
  17. git add Makefile
  18. git commit -m "Bump version $(VERSION) -> $(VERS_MAJOR).$(NEW_MINOR)"
  19. git tag $(VERS_MAJOR).$(NEW_MINOR)
  20. bumpvers-major:
  21. sed -i"" "s/VERS_MAJOR := $(VERS_MAJOR)/VERS_MAJOR := $$(( $(VERS_MAJOR) + 1 ))/" Makefile
  22. git add Makefile
  23. git commit -m "Bump version $(VERSION) -> $(NEW_MAJOR).$(VERS_MINOR)"
  24. git tag $(NEW_MAJOR).$(VERS_MINOR)
  25. release-min:
  26. make bumpvers-minor
  27. make build
  28. release-maj:
  29. make bumpvers-major
  30. make build
  31. PHONY: bumpvers-minor bumpvers-major release-min release-maj clean