Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. VERSION = $(shell git describe --tags --dirty)
  10. .PHONY: dirs
  11. dirs: Makefile
  12. @mkdir -p $(BIN)
  13. .PHONY: install
  14. install:
  15. install -m 775 $(BIN)/* $(PREFIX)/bin
  16. setcap cap_ipc_lock=+ep $(PREFIX)/bin/guardiand
  17. .PHONY: generate
  18. generate: dirs
  19. cd tools && ./build.sh
  20. rm -rf bridge
  21. rm -rf node/pkg/proto
  22. tools/bin/buf generate
  23. .PHONY: node
  24. node: $(BIN)/guardiand
  25. .PHONY: $(BIN)/guardiand
  26. $(BIN)/guardiand: dirs generate
  27. cd node && go build -ldflags "-X github.com/certusone/wormhole/node/pkg/version.version=${VERSION}" \
  28. -mod=readonly -o ../$(BIN)/guardiand \
  29. github.com/certusone/wormhole/node