diff options
-rw-r--r-- | Makefile | 48 |
1 files changed, 20 insertions, 28 deletions
@@ -1,35 +1,27 @@ -SOURCES=git-sonar sonar-base.sh prompt.zsh prompt.bash fetch.sh -PREFIX=$(HOME)/.local +SOURCE=git-sonar +PREFIX?=/usr/local +PWD=$(shell pwd) + +.PHONY: all install develop all: - @echo 'Simple Install script for *git-sonar* ' - @echo 'For a normal installation for your user only use:' - @echo ' make install' - @echo '' - @echo 'If you want to install *git-sonar* system wide you should change' - @echo 'the prefix' + @echo 'Simple install script for *git-sonar*' @echo '' - @echo ' PREFIX=/usr/local/bin make install' + @echo 'For a normal installation into /usr/local, use:' + @echo ' make install' @echo '' - @echo 'For a development install (symlinking files) do:' + @echo 'For a development install (symlinked files), use:' + @echo ' make develop' @echo '' - @echo ' make develop' - -.PHONY: install develop - -install: $(SOURCES) - @echo 'Installing in ' $(PREFIX)/bin - cp git-sonar $(PREFIX)/bin - cp sonar-base.sh $(PREFIX)/bin - cp prompt.zsh $(PREFIX)/bin - cp prompt.bash $(PREFIX)/bin - cp fetch.sh $(PREFIX)/bin + @echo 'If you want to install *git-sonar* for your user only:' + @echo ' PREFIX=$$HOME/.local make install' +install: $(SOURCE) + @echo 'Installing in' $(PREFIX)/bin '...' + mkdir -p $(PREFIX)/bin + cp $(PWD)/$(SOURCE) $(PREFIX)/bin -develop: $(SOURCES) - @echo 'Symlinking in ' $(PREFIX)/bin - ln -s $(PWD)/git-sonar $(PREFIX)/bin/git-sonar - ln -s $(PWD)/sonar-base.sh $(PREFIX)/bin/sonar-base.sh - ln -s $(PWD)/prompt.zsh $(PREFIX)/bin/prompt.zsh - ln -s $(PWD)/prompt.bash $(PREFIX)/bin/prompt.bash - ln -s $(PWD)/fetch.sh $(PREFIX)/bin/fetch.sh +develop: $(SOURCE) + @echo 'Symlinking in' $(PREFIX)/bin '...' + mkdir -p $(PREFIX)/bin + ln -sf $(PWD)/$(SOURCE) $(PREFIX)/bin |