Makefile 451 B

1234567891011121314151617181920212223242526
  1. # This file is subject to a 1-clause BSD license.
  2. # Its contents can be found in the enclosed LICENSE file.
  3. DEBUG=0
  4. REVISION=notabug.org/mouz/bot/app.VersionRevision
  5. ifeq ($(DEBUG),1)
  6. DATE=`date +%s`
  7. LDFLAGS=" -X $(REVISION)=$(DATE)"
  8. else
  9. DATE=`git log -1 --format=%ct`
  10. LDFLAGS="-w -s -X $(REVISION)=$(DATE)"
  11. endif
  12. install: build
  13. go install -ldflags $(LDFLAGS)
  14. build:
  15. go build -ldflags $(LDFLAGS)
  16. all: build install
  17. clean:
  18. go clean