2010-04-01 07:12:01 +02:00
|
|
|
# Get settings from the output of configure by running it to generate
|
|
|
|
# Makefile.config if it doesn't exist yet. And add Makefile.config to
|
|
|
|
# our global dependency list.
|
|
|
|
include Makefile.config
|
|
|
|
global_deps += Makefile.config
|
|
|
|
Makefile.config: configure
|
|
|
|
@echo ""
|
|
|
|
@echo "Note: Calling ./configure with no command-line arguments. This is often fine,"
|
|
|
|
@echo " but if you want to specify any arguments (such as an alternate prefix"
|
|
|
|
@echo " into which to install), call ./configure explicitly and then make again."
|
|
|
|
@echo " See \"./configure --help\" for more details."
|
|
|
|
@echo ""
|
|
|
|
./configure
|
|
|
|
|
|
|
|
# Sub-directory Makefile.local fragments can append to these variables
|
|
|
|
# to have directory-specific cflags as necessary.
|
|
|
|
extra_cflags :=
|
|
|
|
extra_cxxflags :=
|
|
|
|
|
|
|
|
# Smash together user's values with our extra values
|
|
|
|
FINAL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
|
|
|
|
FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
|
|
|
|
FINAL_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS)
|
|
|
|
|
|
|
|
all: notmuch notmuch.1.gz
|
|
|
|
ifeq ($(MAKECMDGOALS),)
|
|
|
|
@echo ""
|
|
|
|
@echo "Compilation of notmuch is now complete. You can install notmuch with:"
|
|
|
|
@echo ""
|
|
|
|
@echo " make install"
|
|
|
|
@echo ""
|
|
|
|
@echo "Note that depending on the prefix to which you are installing"
|
|
|
|
@echo "you may need root permission (such as \"sudo make install\")."
|
|
|
|
@echo "See \"./configure --help\" for help on setting an alternate prefix."
|
|
|
|
endif
|
|
|
|
|
|
|
|
# The user has not set any verbosity, default to quiet mode and inform the
|
|
|
|
# user how to enable verbose compiles.
|
|
|
|
ifeq ($(V),)
|
|
|
|
quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"
|
|
|
|
quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)" $1 $2 $@\n"; $($1)
|
|
|
|
endif
|
|
|
|
# The user has explicitly enabled quiet compilation.
|
|
|
|
ifeq ($(V),0)
|
|
|
|
quiet = @printf " $1 $@\n"; $($1)
|
|
|
|
endif
|
|
|
|
# Otherwise, print the full command line.
|
|
|
|
quiet ?= $($1)
|
|
|
|
|
|
|
|
%.o: %.cc $(global_deps)
|
|
|
|
$(call quiet,CXX,$(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@
|
|
|
|
|
|
|
|
%.o: %.c $(global_deps)
|
|
|
|
$(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@
|
|
|
|
|
|
|
|
%.elc: %.el
|
|
|
|
$(call quiet,EMACS) -batch -f batch-byte-compile $<
|
|
|
|
|
|
|
|
.deps/%.d: %.c $(global_deps)
|
|
|
|
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
|
|
|
|
$(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \
|
|
|
|
sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
|
|
|
|
rm -f $@.$$$$
|
|
|
|
|
|
|
|
.deps/%.d: %.cc $(global_deps)
|
|
|
|
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
|
|
|
|
$(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$ 2>/dev/null ; \
|
|
|
|
sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
|
|
|
|
rm -f $@.$$$$
|
|
|
|
|
|
|
|
DEPS := $(SRCS:%.c=.deps/%.d)
|
|
|
|
DEPS := $(DEPS:%.cc=.deps/%.d)
|
|
|
|
-include $(DEPS)
|
|
|
|
|
|
|
|
.PHONY : clean
|
|
|
|
clean:
|
|
|
|
rm -f $(CLEAN); rm -rf .deps
|
|
|
|
|
2009-11-10 21:03:05 +01:00
|
|
|
notmuch_client_srcs = \
|
2009-12-02 00:23:25 +01:00
|
|
|
$(notmuch_compat_srcs) \
|
2009-11-22 01:44:31 +01:00
|
|
|
debugger.c \
|
|
|
|
gmime-filter-reply.c \
|
2009-11-10 21:03:05 +01:00
|
|
|
notmuch.c \
|
2009-11-12 02:01:55 +01:00
|
|
|
notmuch-config.c \
|
2009-11-21 08:15:07 +01:00
|
|
|
notmuch-count.c \
|
2009-11-10 21:03:05 +01:00
|
|
|
notmuch-dump.c \
|
|
|
|
notmuch-new.c \
|
2009-11-06 19:00:38 +01:00
|
|
|
notmuch-reply.c \
|
2009-11-10 21:03:05 +01:00
|
|
|
notmuch-restore.c \
|
|
|
|
notmuch-search.c \
|
2009-11-23 01:10:55 +01:00
|
|
|
notmuch-search-tags.c \
|
2009-11-10 21:03:05 +01:00
|
|
|
notmuch-setup.c \
|
|
|
|
notmuch-show.c \
|
|
|
|
notmuch-tag.c \
|
|
|
|
notmuch-time.c \
|
2009-11-06 19:00:38 +01:00
|
|
|
query-string.c \
|
2009-12-31 16:17:40 +01:00
|
|
|
show-message.c \
|
|
|
|
json.c
|
2009-11-10 21:03:05 +01:00
|
|
|
|
|
|
|
notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
|
2010-03-12 14:47:34 +01:00
|
|
|
notmuch: $(notmuch_client_modules) lib/libnotmuch.so
|
|
|
|
$(call quiet,CC,$(LDFLAGS)) -Llib -lnotmuch $(filter-out lib/libnotmuch.so,$^) $(FINAL_LDFLAGS) -o $@
|
2009-11-10 16:14:49 +01:00
|
|
|
|
2009-11-18 06:04:31 +01:00
|
|
|
notmuch.1.gz: notmuch.1
|
2009-11-22 04:45:16 +01:00
|
|
|
$(call quiet,gzip) --stdout $^ > $@
|
2009-11-10 16:14:49 +01:00
|
|
|
|
2010-03-10 19:44:44 +01:00
|
|
|
install: all notmuch.1.gz
|
2010-04-01 07:59:30 +02:00
|
|
|
install -d $(DESTDIR)$(prefix)/bin/
|
|
|
|
install -d $(DESTDIR)$(libdir)/
|
|
|
|
install -d $(DESTDIR)$(prefix)/include/
|
|
|
|
install -d $(DESTDIR)$(prefix)/share/man/man1
|
2009-11-17 23:18:47 +01:00
|
|
|
install notmuch $(DESTDIR)$(prefix)/bin/
|
|
|
|
install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
|
2010-03-10 19:48:47 +01:00
|
|
|
ifeq ($(MAKECMDGOALS), install)
|
2010-03-10 19:07:34 +01:00
|
|
|
@echo ""
|
|
|
|
@echo "Notmuch is now installed."
|
|
|
|
@echo ""
|
|
|
|
@echo "You may now want to install additional components to support using notmuch"
|
|
|
|
@echo "together with other software packages:"
|
|
|
|
@echo ""
|
|
|
|
@echo " make install-emacs"
|
|
|
|
@echo " make install-bash"
|
|
|
|
@echo " make install-zsh"
|
2010-03-10 19:48:47 +01:00
|
|
|
@echo ""
|
|
|
|
endif
|
2009-11-10 16:14:49 +01:00
|
|
|
|
2009-11-22 22:17:11 +01:00
|
|
|
install-desktop:
|
|
|
|
install -d $(DESTDIR)$(desktop_dir)
|
|
|
|
desktop-file-install --mode 0644 --dir $(DESTDIR)$(desktop_dir) notmuch.desktop
|
|
|
|
|
2009-12-01 19:14:00 +01:00
|
|
|
install-bash:
|
|
|
|
install -d $(DESTDIR)$(bash_completion_dir)
|
2009-11-29 00:57:37 +01:00
|
|
|
install -m0644 contrib/notmuch-completion.bash \
|
2009-12-01 19:14:00 +01:00
|
|
|
$(DESTDIR)$(bash_completion_dir)/notmuch
|
|
|
|
|
2010-01-08 23:49:34 +01:00
|
|
|
install-zsh:
|
|
|
|
install -d $(DESTDIR)$(zsh_completion_dir)
|
|
|
|
install -m0644 contrib/notmuch-completion.zsh \
|
|
|
|
$(DESTDIR)$(zsh_completion_dir)/notmuch
|
|
|
|
|
2009-11-10 21:03:05 +01:00
|
|
|
SRCS := $(SRCS) $(notmuch_client_srcs)
|
2009-11-20 13:58:39 +01:00
|
|
|
CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) notmuch.elc notmuch.1.gz
|