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
|
|
|
|
|
2009-11-19 01:37:25 +01:00
|
|
|
all_deps = Makefile Makefile.local Makefile.config \
|
|
|
|
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
|
|
|
|
2009-12-02 00:23:25 +01:00
|
|
|
all: notmuch notmuch.1.gz
|
|
|
|
|
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
|
|
|
|
./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
|
|
|
|
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)
|
|
|
|
|
2009-11-19 01:37:25 +01:00
|
|
|
%.o: %.cc $(all_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
|
|
|
|
2009-11-19 01:37:25 +01:00
|
|
|
%.o: %.c $(all_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
|
|
|
|
2009-11-19 01:37:25 +01:00
|
|
|
.deps/%.d: %.c $(all_deps)
|
2009-11-10 17:04:54 +01:00
|
|
|
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
|
2009-12-05 00:08:37 +01:00
|
|
|
$(CC) -M $(CPPFLAGS) $(FINAL_CFLAGS) $< > $@.$$$$; \
|
2009-11-13 07:24:55 +01:00
|
|
|
sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
|
2009-11-10 17:04:54 +01:00
|
|
|
rm -f $@.$$$$
|
|
|
|
|
2009-11-19 01:37:25 +01:00
|
|
|
.deps/%.d: %.cc $(all_deps)
|
2009-11-10 17:04:54 +01:00
|
|
|
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
|
2009-12-05 00:08:37 +01:00
|
|
|
$(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$; \
|
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
|