Skip to content

Commit

Permalink
Make DESTDIR work the way it does for most other packages.
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Kramer <[email protected]>
  • Loading branch information
pioto authored and Jonas Kramer committed Sep 9, 2008
1 parent 9984614 commit 07eb1cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
8 changes: 6 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ Installation:
2. Run "make install" as root.
3. Read the manual for per-user setup information.

NOTE: The Makefile uses /usr as destdir and $DESTDIR/man as MANDIR by default.
NOTE: The Makefile uses /usr as PREFIX and $PREFIX/man as MANDIR by default.
You can override those on the command line. For example, Debian/Ubuntu users
usually have their manuals in /usr/share/man, so they would install shell-fm
like this:

$ make install DESTDIR=/usr MANDIR=/usr/share/man
$ make install PREFIX=/usr MANDIR=/usr/share/man

NOTE: To install a stripped version of shell-fm (about 10K smaller), use
"install-strip" instead of "install":

$ make install-strip

To install to a temporary root (for example, when building a binary
package), you can use the DESTDIR variable, just like with autotools
packages.
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

DESTDIR := /usr
MANDIR := $(DESTDIR)/man
DESTDIR =
PREFIX := /usr
MANDIR := $(PREFIX)/man

.PHONY : shell-fm manual all clean tags cscope

Expand All @@ -13,20 +14,21 @@ manual :
$(MAKE) -C manual

install :
mkdir -p $(DESTDIR)/bin $(MANDIR)/man1
install source/shell-fm $(DESTDIR)/bin/shell-fm
install manual/shell-fm.1.gz $(MANDIR)/man1
install -m 0755 -d $(DESTDIR)$(PREFIX)/bin/
install -m 0755 -d $(DESTDIR)$(MANDIR)/man1/
install -m 0755 source/shell-fm $(DESTDIR)$(PREFIX)/bin/
install -m 0755 manual/shell-fm.1.gz $(DESTDIR)$(MANDIR)/man1/

install-strip : install
strip $(DESTDIR)/bin/shell-fm
strip $(PREFIX)/bin/shell-fm

uninstall :
rm -f $(DESTDIR)/bin/shell-fm
rm -f $(PREFIX)/bin/shell-fm
rm -f $(MANDIR)/man1/shell-fm.1.gz
rmdir --ignore-fail-on-non-empty $(DESTDIR)/bin
rmdir --ignore-fail-on-non-empty $(PREFIX)/bin
rmdir --ignore-fail-on-non-empty $(MANDIR)/man1
rmdir --ignore-fail-on-non-empty $(MANDIR)
rmdir --ignore-fail-on-non-empty $(DESTDIR)
rmdir --ignore-fail-on-non-empty $(PREFIX)


clean :
Expand Down

0 comments on commit 07eb1cd

Please sign in to comment.