Makefile: Change default install prefix from /usr to /usr/local

We'll be a much more polite package this way. And the user can change
the prefix by editing Makefile.config. Still to be done is to make
configure write out Makefile.config and to add a --prefix option to
configure.
This commit is contained in:
Carl Worth 2009-11-17 13:05:16 -08:00
parent 9c2d0714fe
commit e12a6b91ac
3 changed files with 7 additions and 3 deletions

View file

@ -18,6 +18,9 @@ override LDFLAGS += `pkg-config --libs glib-2.0 gmime-2.4 talloc` \
include Makefile.local include Makefile.local
include lib/Makefile.local include lib/Makefile.local
# And get user settings from the output of configure
include Makefile.config
%.o: %.cc %.o: %.cc
$(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@ $(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@

1
Makefile.config Normal file
View file

@ -0,0 +1 @@
prefix = /usr

View file

@ -24,13 +24,13 @@ notmuch.1.gz:
gzip --stdout notmuch.1 > notmuch.1.gz gzip --stdout notmuch.1 > notmuch.1.gz
install: all notmuch.1.gz install: all notmuch.1.gz
for d in $(DESTDIR)/usr/bin/ $(DESTDIR)/usr/share/man/man1 \ for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \
$(DESTDIR)/etc/bash_completion.d/ ; \ $(DESTDIR)/etc/bash_completion.d/ ; \
do \ do \
install -C -d $$d ; \ install -C -d $$d ; \
done ; done ;
install -C notmuch $(DESTDIR)/usr/bin/ install -C notmuch $(DESTDIR)$(prefix)/bin/
install -C notmuch.1.gz $(DESTDIR)/usr/share/man/man1/ install -C notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
install -C notmuch-completion.bash \ install -C notmuch-completion.bash \
$(DESTDIR)/etc/bash_completion.d/notmuch $(DESTDIR)/etc/bash_completion.d/notmuch