Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improved Makefile with BINPREFIX

  • Loading branch information...
commit ad045b77770f51cea3ccf35b8c0d65c0ceb96d3b 1 parent 04076cd
@accerqueira accerqueira authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 Makefile
View
13 Makefile
@@ -1,4 +1,5 @@
PREFIX ?= /usr/local
+BINPREFIX ?= "$(PREFIX)/bin"
MANPREFIX ?= "$(PREFIX)/share/man/man1"
BINS = $(wildcard bin/git-*)
MANS = $(wildcard man/git-*.md)
@@ -9,12 +10,12 @@ docs: $(MAN_HTML) $(MAN_PAGES)
install:
@mkdir -p $(DESTDIR)$(MANPREFIX)
- @mkdir -p $(DESTDIR)$(PREFIX)/bin
- @echo "... installing bins to $(DESTDIR)$(PREFIX)/bin"
+ @mkdir -p $(DESTDIR)$(BINPREFIX)
+ @echo "... installing bins to $(DESTDIR)$(BINPREFIX)"
@echo "... installing man pages to $(DESTDIR)$(MANPREFIX)"
@$(foreach BIN, $(BINS), \
- echo "... installing `basename $(BIN)`"; \
- cp -f $(BIN) $(DESTDIR)$(PREFIX)/$(BIN); \
+ echo "... installing $(notdir $(BIN))"; \
+ cp -f $(BIN) $(DESTDIR)$(BINPREFIX); \
)
cp -f man/git-*.1 $(DESTDIR)$(MANPREFIX)
@mkdir -p $(DESTDIR)/etc/bash_completion.d
@@ -35,8 +36,8 @@ man/%.1: man/%.md
uninstall:
@$(foreach BIN, $(BINS), \
- echo "... uninstalling $(DESTDIR)$(PREFIX)/$(BIN)"; \
- rm -f $(DESTDIR)$(PREFIX)/$(BIN); \
+ echo "... uninstalling $(DESTDIR)$(BINPREFIX)/$(notdir $(BIN))"; \
+ rm -f $(DESTDIR)$(BINPREFIX)/$(notdir $(BIN)); \
)
@$(foreach MAN, $(MAN_PAGES), \
echo "... uninstalling $(DESTDIR)$(MANPREFIX)/$(notdir $(MAN))"; \
Please sign in to comment.
Something went wrong with that request. Please try again.