Makefile 1000 B

12345678910111213141516171819202122232425262728293031323334
  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. ./generate-protos.sh
  20. .PHONY: node
  21. node: $(BIN)/guardiand
  22. .PHONY: $(BIN)/guardiand
  23. $(BIN)/guardiand: dirs generate
  24. cd node && go build -ldflags "-X github.com/certusone/wormhole/node/pkg/version.version=${VERSION}" \
  25. -mod=readonly -o ../$(BIN)/guardiand \
  26. github.com/certusone/wormhole/node