Skip to content

Commit

Permalink
Allow installing to DESTDIR
Browse files Browse the repository at this point in the history
It's pretty standard to allow builders to pass DESTDIR=/some/dir to make
in order to (a) build the program without modifying $PREFIX and (b) still
install somewhere other than $PREFIX. This makes packaging a lot easier.
  • Loading branch information
escondida committed Apr 23, 2016
1 parent 8f7dd09 commit ebeb93d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -290,27 +290,23 @@ soundcard.h:

install: $(NAME)
strip $(BINNAME)$(EXTENSION)
install -d $(PREFIX)/bin
install -d $(MAN_PREFIX)/man/man6
install -c -m 755 $(BINNAME)$(EXTENSION) $(PREFIX)/bin
install -c -m 644 doc/$(NAME).6 $(MAN_PREFIX)/man/man6
@install -D -m 755 $(BINNAME)$(EXTENSION) "$(DESTDIR)$(PREFIX)/bin/$(BINNAME)$(EXTENSION)"
@install -D -m 644 doc/$(NAME).6 "$(DESTDIR)$(MAN_PREFIX)/man/man6/$(NAME).6"

uninstall:
rm -f $(PREFIX)/bin/$(NAME)
rm -f $(MAN_PREFIX)/man/man6/$(NAME).6
@rm -f "$(DESTDIR)$(PREFIX)/bin/$(NAME)"
@rm -f "$(DESTDIR)$(MAN_PREFIX)/man/man6/$(NAME).6"

deinstall: uninstall

install_dumb: d$(NAME)
strip d$(BINNAME)$(EXTENSION)
install -d $(PREFIX)/bin
install -d $(MAN_PREFIX)/man/man6
install -c -m 755 d$(BINNAME)$(EXTENSION) $(PREFIX)/bin
install -c -m 644 doc/d$(NAME).6 $(MAN_PREFIX)/man/man6
@install -D -m 755 d$(BINNAME)$(EXTENSION) "$(DESTDIR)$(PREFIX)/bin/d$(BINNAME)$(EXTENSION)"
@install -D -m 644 doc/d$(NAME).6 "$(DESTDIR)$(MAN_PREFIX)/man/man6/d$(NAME).6"

uninstall_dumb:
rm -f $(PREFIX)/bin/d$(NAME)
rm -f $(MAN_PREFIX)/man/man6/d$(NAME).6
@rm -f "$(DESTDIR)$(PREFIX)/bin/d$(NAME)"
@rm -f "$(DESTDIR)$(MAN_PREFIX)/man/man6/d$(NAME).6"

deinstall_dumb: uninstall_dumb

Expand Down

0 comments on commit ebeb93d

Please sign in to comment.