Skip to content

Commit

Permalink
Copy go binary seperately in make install
Browse files Browse the repository at this point in the history
Signed-off-by: hemildesai <hemil.desai10@gmail.com>
  • Loading branch information
hemildesai committed Dec 24, 2020
1 parent d83cc47 commit aecea77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ else ifeq ($(OS),Darwin)
else
@echo Unknown OS: $(OS)
endif
cd go && $(MAKE) copy-binary

.PHONY: develop
develop: verify-dev-env venv
Expand Down
7 changes: 5 additions & 2 deletions go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ build-all:

# install without sudo if the install path exists and is writeable,
# or if it doesn't exist and its directory is writeable
.PHONY: install
install: build
.PHONY: copy-binary
copy-binary:
if [[ (-f "$(INSTALL_PATH)" && -w "$(INSTALL_PATH)") || (! -f "$(INSTALL_PATH)" && -w $$(dirname "$(INSTALL_PATH)")) ]]; then \
cp $(BINARY) $(INSTALL_PATH); \
else \
sudo cp $(BINARY) $(INSTALL_PATH); \
fi

.PHONY: install
install: build copy-binary

.PHONY: clean
clean:
rm -rf $(RELEASE_DIR)
Expand Down

0 comments on commit aecea77

Please sign in to comment.