Commit graph

60 commits

Author SHA1 Message Date
Carl Worth
b5d8fe2784 Makefile: Move the completion-specific commands to completion/Makefile.local
For much better modularity.
2010-04-06 14:36:31 -07:00
Carl Worth
0f34809197 Makefile: Eliminate the separate install-bash and install-zsh targets.
Again, simplifying the interface to the Makefile. Installing these
files doesn't require bash nor zsh to actually be installed, so there's
little harm in just installing them unconditionally.
2010-04-06 14:36:31 -07:00
Carl Worth
a5ed8c68f6 Makefile: Eliminate the "make install-emacs" target.
Instead, simply byte-compile the emacs source files as part of "make"
and install them as part of "make install". The byte compilation is
made conditional on the configure script finding the emacs binary.
That way, "make; make install" will still work for someone that doesn't
have emacs installed, (which was the only reason we had made a separate
"make install-emacs" target in the first place).
2010-04-06 14:36:31 -07:00
Carl Worth
f89b3d16db Makefiles: Eliminate the useless quiet_* functions.
With the original quiet function, there's an actual purpose (hiding
excessively long compiler command lines so that warnings and errors
from the compiler can be seen).

But with things like quiet_symlink there's nothing quieter. In fact
"SYMLINK" is longer than "ln -sf". So all this is doing is hiding the
actual command from the user for no real benefit.

The only actual reason we implemented the quiet_* functions was to be
able to neatly right-align the command name and left-align the arguments.

Let's give up on that, and just left-align everything, simplifying the
Makefiles considerably. Now, the only instances of a captialized command
name in the output is if there's some actually shortening of the command
itself.
2010-04-06 14:36:31 -07:00
Carl Worth
4c7ee0f016 Makefile: Finish implementing the "make release" target.
And hopefully it actually works.
2010-04-05 15:46:05 -07:00
Carl Worth
cdb6e12d8c Makefile: Start implementing a "make release" target.
So far just doing checks that the version is sane and that no release
of the same version already exists.
2010-04-05 15:31:15 -07:00
Carl Worth
04e816416f Makefile: Add a dist target.
To create a versioned tar file for release.
2010-04-05 14:22:00 -07:00
Carl Worth
4235ef5109 Makfiles: Make the top-level targets PHONY
Just to avoid any clash with files of the same names.
2010-04-05 12:59:06 -07:00
David Edmondson
d3884a5984 Makefile.local: Automatically use makefile mode
We add a magic line to the beginning of each Makefile.local file to
help the editor know that it should use makefile mode for editing the
file, (even though the filename isn't exactly "Makefile").

Edited-by: Carl Worth <cworth@cworth.org>: Expand treatment from
emacs/Makefile.local to each instance of Makefile.local.
2010-04-03 12:31:49 -07:00
David Edmondson
7b1566db8a Makefile: Add the emacs directory to load-path when compiling
Reviewed-by: Carl Worth <cworth@cworth.org>: Presumably, this is to
enable proper building in the very near-term future where the emacs
implementation consists of multiple files where some will `require'
functions from others.
2010-04-03 12:11:55 -07:00
Carl Worth
a07962d3ec Makefile: Only print the "make install" hint after the first build.
It was getting quite annoying to see this big block of text on every
little build, (but I didn't want to get rid of it for any new users).
This seems to strike the right balance.
2010-04-02 14:06:32 -07:00
Carl Worth
b2a9fcd5cf notmuch: Add a version (0.1 initially) with a new --version option.
We're planning to do actual releases soon, so we need a version
number to put into the tar file.
2010-04-02 11:55:09 -07:00
Carl Worth
f689c83af4 Compile a static notmuch binary (but only install the shared version)
The idea here is to allow a new user of notmuch to be able to run
notmuch immediately after compiling, (without having to install
the shared library first). This also ensures that the test suite
tests the locally compiled library, and not whatever installled
version of the library the dynamic linker happens to find.
2010-04-01 15:03:40 -07:00
Carl Worth
c0961e6a82 lib: Switch to a 3-part version number for the library interface.
With a carefully documented description of how to increment the
various version components.
2010-04-01 00:41:25 -07:00
Carl Worth
c20be126e5 Makefiles: Align the columns of output.
Much better.
2010-04-01 00:07:08 -07:00
Carl Worth
33d5cc415e Makefiles: Make the install rules quiet like the compilation rules.
The output from make is looking better all the time, (though the
columns still aren't lined up).
2010-03-31 23:54:21 -07:00
Carl Worth
e7131a5983 Makefile: Fix to print CFLAGS with "make V=0"
The default "make" would be quite quiet, but still conveniently print
the CFLAGS. The explicit "make V=0" was intended to be identical, (only
not printing the message about V=1 but was broken in that it left the
CFLAGS off). Fix this.
2010-03-31 23:32:35 -07:00
Carl Worth
8c671a17c0 Makefiles: Eliminate shell for loops in rule definitions.
These just made the output look so ugly, and weren't actually making
the rule definitions any simpler. Good riddance.
2010-03-31 22:59:30 -07:00
Carl Worth
7b52b2c318 Move installation of library from top-level to lib/Makefile.local
We had a fairly ugly violation of modularity with the top-level
Makefile.local isntalling everything, (even when the build commands
for the library were down in lib/Makefile.local).
2010-03-31 22:54:15 -07:00
Carl Worth
ab95219a2f Move some variable assignments from Makefile.local to Makefile.config
There's not any special configure logic for determining these variable
values, but if we did add some in the future, then these will now be
in the right place for that.

Additionally, this now makes Makefile.local the single place for the
user to look for manually tweaking a variable assignment, (say, for a
compiler that can't accept a particular warning argument).

With this change, there should rarely be any need for a user to poke
into any Makefile.local file.
2010-03-31 22:54:08 -07:00
Carl Worth
784e55d0f9 Move bulk of rules from Makefile to Makefile.local.
Before it was impossible to know whether any particular setting or
rule definition was in Makefile or Makefile.local. So we strip the
Makefile down to little more than the list of sub-directories and
the logic to include all of the sub-directories' Makefile.local
fragments.

Then, all of the real work can happen inside of Makefile.local.
2010-03-31 22:12:01 -07:00
Ingmar Vanhassel
acaff279e2 Add a --libdir option to ./configure
This allows packagers to specify to which directory libraries should be
installed.

Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
2010-03-31 18:07:58 -07:00
Ben Gamari
266ab595a2 Build and link against notmuch shared library, install notmuch.h
Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
2010-03-31 17:38:27 -07:00
Carl Worth
b6df83bef0 Makefile: Conditionalize the "make install" message.
This is the same approach as with the 'all' target previously.
2010-03-10 10:48:47 -08:00
Carl Worth
985263cf51 Makefile: Simplify the conditional message of the all target.
We wamt a simple "make" to call the 'all' target and then print a
message when done, but we don't want "make install" which depends on
that same 'all' target to print the message.

We previously did this with a separate 'all-without-message' target,
which was inelegant because it caused all users of the target to
carefully depend on 'all-without-message' rather than 'all'.

Instead, we now use a single 'all' target but with a Makefile
conditional that examines the MAKECMDGOALS variable to determine
whether to print the message.
2010-03-10 10:44:44 -08:00
Carl Worth
adf5c5ec35 Makefile: Add message to make install listing the other install targets.
Otherwise, it's hard for the user to know that things like install-emacs,
install-bash, and install-zsh even exist.
2010-03-10 10:07:34 -08:00
Carl Worth
2b8131f079 Makefile: Add a meesage after "make" telling the user to run "make install"
As one command completes, it's kind of the tool to indicate which
command the user should execute next.
2010-03-09 17:03:11 -08:00
David Bremner
bbda0a0156 emacs: Move emacs UI (currently just one file) to subdirectory.
Add emacs/Makefile.local and emacs/Makefile. Move emacs targets into
emacs/Makefile.local, but leave the byte compilation rule in the top
level Makefile.
2010-03-09 12:13:33 -08:00
Scott Robinson
6ce2bf68f5 Add an "--format=(json|text)" command-line option to both notmuch-search and notmuch-show.
In the case of notmuch-show, "--format=json" also implies
"--entire-thread" as the thread structure is implicit in the emitted
document tree.

As a coincidence to the implementation, multipart message ID numbers are
now incremented with each part printed. This changes the previous
semantics, which were unclear and not necessary related to the actual
ordering of the message parts.
2010-02-23 12:01:12 -08:00
Jeffrey C. Ollie
1bf121924d Add install target for notmuch.desktop file.
Add an install target that uses desktop-file-install to install the
desktop file in the appropriate location.  The location of the install
can be modified by changing the desktop_dir variable.

Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>
2010-01-24 07:29:54 +13:00
martin f. krafft
1ef33800df Install zsh completion file
According to the Debian zsh maintainer Clint Adams, this is the first
time that a package installs its own completer into zsh. Part of the
reason this is not usually done is because zsh does not provide a stable
API.

We agreed to try it, given that notmuch is expected to change quite
a bit initially. If there are problems or the completer goes stable,
we'll move it into the upstream zsh repository.

Signed-off-by: martin f. krafft <madduck@debian.org>
2010-01-14 18:12:13 +13:00
Jameson Graef Rollins
263aeb82f0 fix Makefile.local to install bash completion definitions as not executable 2009-12-04 16:14:39 -08:00
Carl Worth
c7f971e8c0 Fix quiet compilation to print the user's CFLAGS, CXXFLAGS, LDFLAGS.
The only reason I ever call "make V=1" myself, (other than when
debugging the compiler command-line for some reason), is to ensure
whether my CFLAGS, (like "-g -O0" or "-O2"), are actually making it to
the command-line.

But these are hard to find in the V=1 output, and really, we should
just print these even in the quiet case. So do that.
2009-12-04 15:08:37 -08:00
Carl Worth
880b21a097 Makefile: Incorporate getline implementation into the build.
It's unconditional for a very short time. We expect to soon be
building it only if necessary.
2009-12-01 16:33:17 -08:00
Carl Worth
7c2c26bc4e Makefile: Add new "install-bash" target for bash completion support
It was problematic to have this in "make install" since it would
unconditionally try to install to /etc, (even if a non-privileged user
was attempting an install to a prefix in the user's home directory,
for example).
2009-12-01 10:14:00 -08:00
Jan Janak
f8baa02335 notmuch: New command 'search-tags'.
This is a new notmuch command that can be used to search for all tags
found in the database. The resulting list is alphabetically sorted.

The primary use-case for this new command is to provide the tag
completion feature in Emacs (and other interfaces).

Signed-off-by: Jan Janak <jan@ryngle.com>
2009-11-26 07:02:48 -08:00
Keith Packard
53f8cc5651 Add 'notmuch count' command to show the count of matching messages
Getting the count of matching threads or messages is a fairly
expensive operation. Xapian provides a very efficient mechanism that
returns an approximate value, so use that for this new command.

This returns the number of matching messages, not threads, as that is
cheap to compute.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-23 06:33:54 +01:00
Chris Wilson
986f6c9824 notmuch-new: Only install SIGALRM if not running under gdb
I felt sorry for Carl trying to step through an exception from xapian
and suffering from the SIGALARMs..

We can detect if the user launched notmuch under a debugger by either
checking our cmdline for the presence of the gdb string or querying if
valgrind is controlling our process. For the latter we need to add a
compile time check for the valgrind development library, and so add the
initial support to build Makefile.config from configure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Carl Worth <cworth@cworth.org>
[ickle: And do not install the timer when under the debugger]
2009-11-22 05:36:36 +01:00
Carl Worth
1266d8511e Makefile: Fix to work even with GZIP environment variable set.
The rule here was written to assume that if the GZIP environment
variable was set that it would be the gzip binary to execute,
(similar to the CC and CXX variables). But GZIP is actually used
to pass arguments to gzip, so we have to use a different name.
2009-11-22 04:45:16 +01:00
Chris Wilson
530df68258 Makefile: Magic silent rules.
Use the facilities of GNU make to create a magic function that will
on the first invocation print a description of how to enable verbose
compile lines and then print the quiet rule.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Carl Worth <cworth@cworth.org>
Cc: Mikhail Gusarov <dottedmag@dottedmag.net>

[ickle: Rebased, and duplicate command string eliminated.]
[ickle: Fixed verbose bug pointed out by Mikhail]
2009-11-22 04:29:29 +01:00
James Rowe
a8e0d4f25f Make bash completion directory configurable.
Some systems install completion scripts in /usr/share/bash-completion, make the
location configurable from Makefile.config.
2009-11-21 00:14:06 +01:00
Ingmar Vanhassel
14807ed2de bash-completion: Move to contrib
Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
2009-11-20 18:05:51 +01:00
Mikhail Gusarov
4dec742eba Add notmuch.1.gz to files to be cleaned
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2009-11-20 17:06:58 +01:00
Jeffrey C. Ollie
d98718d104 Improve installation of emacs mode.
1) Add a separate targets to build and install emacs mode.

2) Don't hardcode the installation directory, instead use emacs'
   pkg-config module.

3) Install a byte compiled version of the emacs mode.

4) Install the emacs mode in emacs' site-lisp directory.  Put
   "(require 'notmuch)" in your .emacs to load it automatically.

5) Ignore byte-compiled emacs files.

Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>
Reviewed-by: Ingmar Vanhassel <ingmar@exherbo.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-11-20 10:34:29 +01:00
Peter Wang
ddac17343a Put $(LDFLAGS) after the list of object files.
Some linkers on some systems are particularly picky about the order of
arguments in order to properly linkt. So this fixes failures on some
systems.
2009-11-19 18:05:22 +01:00
Ingmar Vanhassel
aa8c2224ee Makefile: Create elisp install directory explicitly
When doing a DESTDIR install, this directory likely won't exist, and
installing notmuch.el will fail.

See 0d4b5292
2009-11-19 12:24:11 +01:00
Carl Worth
0d4b529297 Makefile: Actually install the emacs mode.
Should have been doing this a long time ago.
2009-11-19 00:27:34 +01:00
Stewart Smith
b032cf98f5 Fix linking with gcc to use g++ to link in C++ libs.
Previously, Ubuntu 9.10, gcc 4.4.1 was getting:

/usr/bin/ld: lib/notmuch.a(database.o): in function global
constructors keyed to BOOLEAN_PREFIX_INTERNAL:database.cc(.text+0x3a):
error: undefined reference to 'std::ios_base::Init::Init()'
2009-11-18 05:34:02 -08:00
Jan Janak
835e3a6977 Older versions of install do not support -C.
Do not use -C cmdline option of install, older versions, commonly found in
distributions like Debian, do not seem to support it. Running make install
on such systems (tested on Debian Lenny) fails.

Signed-off-by: Jan Janak <jan@ryngle.com>
2009-11-18 02:41:15 -08:00
Carl Worth
544df2f517 Makefile: Fix missing dependency for notmuch.1 manual page.
The Makefile was failing to regnerate the notmuch.1.gz file when
notmuch.1 was updated, (so stale documentation could potentially be
installed).
2009-11-17 21:04:31 -08:00