Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Makefile for production builds. This is not meant, or optimized, for incremental or debug builds. Use the devnet for
  2. # development. For the sake of decentralization, we specifically avoid the use of prebuilt containers wherever possible
  3. # to increase diversity - operators sourcing their compiler binaries from different sources is a good thing.
  4. SHELL = /usr/bin/env bash
  5. MAKEFLAGS += --no-builtin-rules
  6. PREFIX ?= /usr/local
  7. OUT = build
  8. BIN = $(OUT)/bin
  9. -include Makefile.help
  10. # VERSION is the git tag of the current commit if there's a tag, otherwise it's "dev-" plus the git commit sha.
  11. VERSION = $(shell git describe --tags --dirty 2>/dev/null || echo "dev-$(shell git rev-parse --short HEAD)")
  12. .PHONY: dirs
  13. dirs: Makefile
  14. @mkdir -p $(BIN)
  15. .PHONY: install
  16. ## Install guardiand binary
  17. install:
  18. install -m 775 $(BIN)/* $(PREFIX)/bin
  19. setcap cap_ipc_lock=+ep $(PREFIX)/bin/guardiand
  20. .PHONY: generate
  21. generate: dirs
  22. cd tools && ./build.sh
  23. rm -rf bridge
  24. rm -rf node/pkg/proto
  25. tools/bin/buf generate
  26. .PHONY: lint
  27. lint:
  28. bash scripts/lint.sh lint
  29. .PHONY: node
  30. ## Build guardiand binary
  31. node: $(BIN)/guardiand
  32. .PHONY: $(BIN)/guardiand
  33. $(BIN)/guardiand: CGO_ENABLED=1
  34. $(BIN)/guardiand: dirs generate
  35. cd node && go build -ldflags "-X github.com/certusone/wormhole/node/pkg/version.version=${VERSION}" \
  36. -mod=readonly -o ../$(BIN)/guardiand \
  37. github.com/certusone/wormhole/node