소스 검색

Add local install option

Add install-local and uninstall-local in Makefile
pull/723/head
Jonathan-M-C 3 년 전
부모
커밋
4547f13811
1개의 변경된 파일29개의 추가작업 그리고 1개의 파일을 삭제
  1. +29
    -1
      Makefile

+ 29
- 1
Makefile 파일 보기

@@ -7,6 +7,34 @@ endif
ifndef MANPREFIX
MANPREFIX = $(PREFIX)/share/man
endif
ifndef XDG_DATA_HOME
XDG_DATA_HOME = $(HOME)/.local/share
endif

DESTDIR = mutt-wizard
PREFIX_LOCAL = $(XDG_DATA_HOME)
BIN_LOCAL = $(HOME)/.local/bin
MANPREFIX_LOCAL = $(PREFIX_LOCAL)/man

install-local:
cp -f bin/mw bin/mailsync bin/openfile $(BIN_LOCAL)
mkdir -p $(PREFIX_LOCAL)/$(DESTDIR)
cp -f share/mailcap share/domains.csv share/mutt-wizard.muttrc $(PREFIX_LOCAL)/$(DESTDIR)
mkdir -p $(MANPREFIX_LOCAL)/man1
cp -f mw.1 $(MANPREFIX_LOCAL)/man1/mw.1
if [ "$(PREFIX_LOCAL)" ]; then \
sed -iba 's:/usr/local:$(PREFIX_LOCAL):' $(PREFIX_LOCAL)/$(DESTDIR)/mutt-wizard.muttrc; \
rm -f $(PREFIX_LOCAL)/$(DESTDIR)/mutt-wizard.muttrcba; \
sed -iba 's:/usr/local:$(PREFIX_LOCAL):' $(BIN_LOCAL)/mw; \
rm -f $(BIN_LOCAL)/mwba; \
sed -iba 's:/usr/local:$(PREFIX_LOCAL):' $(MANPREFIX_LOCAL)/man1/mw.1; \
rm -f $(MANPREFIX_LOCAL)/man1/mw.1ba; \
fi

uninstall-local:
rm -f $(BIN_LOCAL)/mw $(BIN_LOCAL)/mailsync $(BIN_LOCAL)/openfile
rm -rf $(PREFIX_LOCAL)/$(DESTDIR)
rm -f $(MANPREFIX_LOCAL)/man1/mw.1

install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
@@ -33,4 +61,4 @@ uninstall:
rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard
rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1

.PHONY: install uninstall
.PHONY: install-local uninstall-local install uninstall

불러오는 중...
취소
저장