Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright (c) 2020 Docker Inc.
  2. # Permission is hereby granted, free of charge, to any person
  3. # obtaining a copy of this software and associated documentation
  4. # files (the "Software"), to deal in the Software without
  5. # restriction, including without limitation the rights to use, copy,
  6. # modify, merge, publish, distribute, sublicense, and/or sell copies
  7. # of the Software, and to permit persons to whom the Software is
  8. # furnished to do so, subject to the following conditions:
  9. # The above copyright notice and this permission notice shall be
  10. # included in all copies or substantial portions of the Software.
  11. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  12. # EXPRESS OR IMPLIED,
  13. # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  15. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  16. # HOLDERS BE LIABLE FOR ANY CLAIM,
  17. # DAMAGES OR OTHER LIABILITY,
  18. # WHETHER IN AN ACTION OF CONTRACT,
  19. # TORT OR OTHERWISE,
  20. # ARISING FROM, OUT OF OR IN CONNECTION WITH
  21. # THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. GIT_COMMIT=$(shell git rev-parse --short HEAD)
  23. GOOS ?= $(shell go env GOOS)
  24. PROTOS=$(shell find . -name \*.proto)
  25. export GO111MODULE=auto
  26. all: protos example cli
  27. cli:
  28. cd cmd && go build -v -o ../bin/docker
  29. protos:
  30. @protoc -I. --go_out=plugins=grpc,paths=source_relative:. ${PROTOS}
  31. example:
  32. cd example/backend && go build -v -o ../../bin/backend-example
  33. FORCE:
  34. .PHONY: protos example cli