2009-11-18 00:23:42 +01:00
|
|
|
# Default FLAGS, (can be overridden by user such as "make CFLAGS=-O2")
|
2009-10-26 00:07:46 +01:00
|
|
|
WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum
|
2009-11-10 17:36:41 +01:00
|
|
|
CFLAGS=-O2
|
2009-10-25 23:19:36 +01:00
|
|
|
|
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-11-10 17:27:48 +01:00
|
|
|
# Additional flags that we will append to whatever the user set.
|
|
|
|
# These aren't intended for the user to manipulate.
|
2009-11-18 12:34:54 +01:00
|
|
|
extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc)
|
|
|
|
extra_cxxflags := $(shell xapian-config --cxxflags)
|
2009-10-25 23:19:36 +01:00
|
|
|
|
2009-11-19 22:20:01 +01:00
|
|
|
emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir)
|
2009-11-20 13:07:42 +01:00
|
|
|
# Hard-code if this system doesn't have an emacs.pc file
|
|
|
|
ifeq ($(emacs_lispdir),)
|
2009-11-21 11:38:27 +01:00
|
|
|
emacs_lispdir = $(prefix)/share/emacs/site-lisp
|
2009-11-20 13:07:42 +01:00
|
|
|
endif
|
2009-11-19 22:20:01 +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-11-10 17:27:48 +01:00
|
|
|
# Now smash together user's values with our extra values
|
2009-11-10 17:34:54 +01:00
|
|
|
override CFLAGS += $(WARN_FLAGS) $(extra_cflags)
|
|
|
|
override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)
|
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-18 12:34:54 +01:00
|
|
|
override LDFLAGS += \
|
|
|
|
$(shell pkg-config --libs glib-2.0 gmime-2.4 talloc) \
|
|
|
|
$(shell xapian-config --libs)
|
2009-10-13 00:50:02 +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-02 01:38:47 +01:00
|
|
|
quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)" $1 $@\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-11-21 21:32:20 +01:00
|
|
|
$(call quiet,CXX) -c $(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-11-21 21:32:20 +01:00
|
|
|
$(call quiet,CC) -c $(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-11-10 17:27:48 +01:00
|
|
|
$(CC) -M $(CPPFLAGS) $(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-11-10 17:27:48 +01:00
|
|
|
$(CXX) -M $(CPPFLAGS) $(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
|