2009-12-02 01:42:50 +01:00
|
|
|
WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
|
|
|
|
WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations
|
|
|
|
|
2009-11-21 21:32:20 +01:00
|
|
|
# Additional programs that are used during the compilation process.
|
|
|
|
EMACS ?= emacs
|
2009-11-22 04:45:16 +01:00
|
|
|
# Lowercase to avoid clash with GZIP environment variable for passing
|
|
|
|
# arguments to gzip.
|
|
|
|
gzip = gzip
|
2009-11-21 21:32:20 +01:00
|
|
|
|
2009-12-01 19:14:00 +01:00
|
|
|
bash_completion_dir = /etc/bash_completion.d
|
2010-01-08 23:49:34 +01:00
|
|
|
zsh_completion_dir = /usr/share/zsh/functions/Completion/Unix
|
2009-12-01 19:14:00 +01:00
|
|
|
|
2010-03-10 02:01:55 +01:00
|
|
|
global_deps = Makefile Makefile.local Makefile.config \
|
2009-11-19 01:37:25 +01:00
|
|
|
lib/Makefile lib/Makefile.local
|
|
|
|
|
2009-12-02 02:56:39 +01:00
|
|
|
extra_cflags :=
|
|
|
|
extra_cxxflags :=
|
|
|
|
|
2009-11-10 17:27:48 +01:00
|
|
|
# Now smash together user's values with our extra values
|
2009-12-05 00:08:37 +01:00
|
|
|
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)
|
notmuch: Start actually adding messages to the index.
This is the beginning of the notmuch library as well, with its
interface in notmuch.h. So far we've got create, open, close, and
add_message (all with a notmuch_database prefix).
The current add_message function has already been whittled down from
what we have in notmuch-index-message to add only references,
message-id, and thread-id to the index, (that is---just enough to do
thread-linkage but nothing for full-text searching).
The concept here is to do something quickly so that the user can get
some data into notmuch and start using it. (The most interesting stuff
is then thread-linkage and labels like inbox and unread.) We can
defer the full-text indexing of the body of the messages for later,
(such as in the background while the user is reading mail).
The initial thread-stitching step is still slower than I would like.
We may have to stop using libgmime for this step as its overhead is
not worth it for the simple case of just parsing the message-id,
references, and in-reply-to headers.
2009-10-19 05:56:30 +02:00
|
|
|
|
2010-03-10 02:03:11 +01:00
|
|
|
all: all-without-message
|
|
|
|
@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."
|
|
|
|
|
|
|
|
all-without-message: notmuch notmuch.1.gz
|
2009-12-02 00:23:25 +01:00
|
|
|
|
2009-12-02 01:00:31 +01:00
|
|
|
# Before including any other Makefile fragments, get settings from the
|
|
|
|
# output of configure
|
2009-12-01 17:34:09 +01:00
|
|
|
Makefile.config: configure
|
2009-12-05 00:32:05 +01:00
|
|
|
@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."
|
2009-12-05 01:09:40 +01:00
|
|
|
@echo " See \"./configure --help\" for more details."
|
2009-12-05 00:32:05 +01:00
|
|
|
@echo ""
|
2009-12-01 17:34:09 +01:00
|
|
|
./configure
|
|
|
|
|
2009-11-17 22:05:16 +01:00
|
|
|
include Makefile.config
|
|
|
|
|
2009-12-02 01:00:31 +01:00
|
|
|
include lib/Makefile.local
|
|
|
|
include compat/Makefile.local
|
2010-02-10 04:45:28 +01:00
|
|
|
include emacs/Makefile.local
|
2009-12-02 01:00:31 +01:00
|
|
|
include Makefile.local
|
|
|
|
|
2009-11-21 21:32:20 +01:00
|
|
|
# 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"
|
2009-12-05 00:08:37 +01:00
|
|
|
quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)" $1 $2 $@\n"; $($1)
|
2009-11-21 21:32:20 +01:00
|
|
|
endif
|
|
|
|
# The user has explicitly enabled quiet compilation.
|
|
|
|
ifeq ($(V),0)
|
2009-12-02 01:38:47 +01:00
|
|
|
quiet = @printf " $1 $@\n"; $($1)
|
2009-11-21 21:32:20 +01:00
|
|
|
endif
|
|
|
|
# Otherwise, print the full command line.
|
|
|
|
quiet ?= $($1)
|
|
|
|
|
2010-03-10 02:01:55 +01:00
|
|
|
%.o: %.cc $(global_deps)
|
2009-12-05 00:08:37 +01:00
|
|
|
$(call quiet,CXX,$(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@
|
notmuch: Start actually adding messages to the index.
This is the beginning of the notmuch library as well, with its
interface in notmuch.h. So far we've got create, open, close, and
add_message (all with a notmuch_database prefix).
The current add_message function has already been whittled down from
what we have in notmuch-index-message to add only references,
message-id, and thread-id to the index, (that is---just enough to do
thread-linkage but nothing for full-text searching).
The concept here is to do something quickly so that the user can get
some data into notmuch and start using it. (The most interesting stuff
is then thread-linkage and labels like inbox and unread.) We can
defer the full-text indexing of the body of the messages for later,
(such as in the background while the user is reading mail).
The initial thread-stitching step is still slower than I would like.
We may have to stop using libgmime for this step as its overhead is
not worth it for the simple case of just parsing the message-id,
references, and in-reply-to headers.
2009-10-19 05:56:30 +02:00
|
|
|
|
2010-03-10 02:01:55 +01:00
|
|
|
%.o: %.c $(global_deps)
|
2009-12-05 00:08:37 +01:00
|
|
|
$(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@
|
notmuch: Start actually adding messages to the index.
This is the beginning of the notmuch library as well, with its
interface in notmuch.h. So far we've got create, open, close, and
add_message (all with a notmuch_database prefix).
The current add_message function has already been whittled down from
what we have in notmuch-index-message to add only references,
message-id, and thread-id to the index, (that is---just enough to do
thread-linkage but nothing for full-text searching).
The concept here is to do something quickly so that the user can get
some data into notmuch and start using it. (The most interesting stuff
is then thread-linkage and labels like inbox and unread.) We can
defer the full-text indexing of the body of the messages for later,
(such as in the background while the user is reading mail).
The initial thread-stitching step is still slower than I would like.
We may have to stop using libgmime for this step as its overhead is
not worth it for the simple case of just parsing the message-id,
references, and in-reply-to headers.
2009-10-19 05:56:30 +02:00
|
|
|
|
2009-11-19 22:20:01 +01:00
|
|
|
%.elc: %.el
|
2009-11-21 21:32:20 +01:00
|
|
|
$(call quiet,EMACS) -batch -f batch-byte-compile $<
|
2009-11-19 22:20:01 +01:00
|
|
|
|
2010-03-10 02:01:55 +01:00
|
|
|
.deps/%.d: %.c $(global_deps)
|
2009-11-10 17:04:54 +01:00
|
|
|
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
|
2009-12-05 00:37:39 +01:00
|
|
|
$(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \
|
2009-11-13 07:24:55 +01:00
|
|
|
sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
|
2009-11-10 17:04:54 +01:00
|
|
|
rm -f $@.$$$$
|
|
|
|
|
2010-03-10 02:01:55 +01:00
|
|
|
.deps/%.d: %.cc $(global_deps)
|
2009-11-10 17:04:54 +01:00
|
|
|
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
|
2009-12-05 00:37:39 +01:00
|
|
|
$(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$ 2>/dev/null ; \
|
2009-11-13 07:24:55 +01:00
|
|
|
sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
|
2009-11-10 17:04:54 +01:00
|
|
|
rm -f $@.$$$$
|
|
|
|
|
|
|
|
DEPS := $(SRCS:%.c=.deps/%.d)
|
|
|
|
DEPS := $(DEPS:%.cc=.deps/%.d)
|
|
|
|
-include $(DEPS)
|
2009-10-30 20:00:55 +01:00
|
|
|
|
2009-11-22 13:55:35 +01:00
|
|
|
.PHONY : clean
|
2009-10-13 00:50:02 +02:00
|
|
|
clean:
|
2009-11-10 17:04:54 +01:00
|
|
|
rm -f $(CLEAN); rm -rf .deps
|