From d8d80fbb13b4d309cfc28163b0cf4f755933237d Mon Sep 17 00:00:00 2001 From: iofq Date: Sat, 28 May 2022 06:52:53 -0500 Subject: [PATCH] Add install target in Makefile, move old behavior to go-install --- Makefile | 15 ++++++++++++--- README.md | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index aad6960056..edc788c547 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ SHELL=/usr/bin/env bash PROJECTNAME=$(shell basename "$(PWD)") LDFLAGS="-X 'main.buildTime=$(shell date)' -X 'main.lastCommit=$(shell git rev-parse HEAD)' -X 'main.semanticVersion=$(shell git describe --tags --dirty=-dev)'" +ifeq (${PREFIX},) + PREFIX := /usr/local +endif ## help: Get more info on make commands. help: Makefile @@ -19,12 +22,18 @@ clean: @echo "--> Cleaning up ./build" @rm -rf build/* -## install: Build and install the celestia-node binary into the GOBIN directory. -install: +## install: Build and install the celestia-node binary into the $PREFIX (/usr/local/ by default) directory. +install: build @echo "--> Installing Celestia" - @go install -ldflags ${LDFLAGS} ./cmd/celestia + @install -v ./build/* -t ${PREFIX}/bin/ .PHONY: install +## go-install: Build and install the celestia-node binary into the GOBIN directory. +go-install: + @echo "--> Installing Celestia" + @go install -ldflags ${LDFLAGS} ./cmd/celestia +.PHONY: go-install + ## shed: Build cel-shed binary. cel-shed: @echo "--> Building cel-shed" diff --git a/README.md b/README.md index 6f8d6800e2..eacf682d7c 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ See the official docs page for system requirements per node type: ```sh git clone https://github.com/celestiaorg/celestia-node.git cd celestia-node -make install +make build +sudo make install ``` For more information on setting up a node and the hardware requirements needed, go visit our docs at .