mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-28 21:54:10 +01:00
Build and link against notmuch shared library, install notmuch.h
Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
This commit is contained in:
parent
b957a1b029
commit
266ab595a2
4 changed files with 14 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,6 +5,7 @@ tags
|
||||||
.deps
|
.deps
|
||||||
notmuch
|
notmuch
|
||||||
notmuch.1.gz
|
notmuch.1.gz
|
||||||
|
libnotmuch.so*
|
||||||
*.[ao]
|
*.[ao]
|
||||||
*~
|
*~
|
||||||
.*.swp
|
.*.swp
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -1,3 +1,4 @@
|
||||||
|
SONAME = libnotmuch.so.1
|
||||||
WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
|
WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
|
||||||
WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations
|
WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations
|
||||||
|
|
||||||
|
|
|
@ -20,18 +20,22 @@ notmuch_client_srcs = \
|
||||||
json.c
|
json.c
|
||||||
|
|
||||||
notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
|
notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
|
||||||
notmuch: $(notmuch_client_modules) lib/notmuch.a
|
notmuch: $(notmuch_client_modules) lib/libnotmuch.so
|
||||||
$(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -o $@
|
$(call quiet,CC,$(LDFLAGS)) -Llib -lnotmuch $(filter-out lib/libnotmuch.so,$^) $(FINAL_LDFLAGS) -o $@
|
||||||
|
|
||||||
notmuch.1.gz: notmuch.1
|
notmuch.1.gz: notmuch.1
|
||||||
$(call quiet,gzip) --stdout $^ > $@
|
$(call quiet,gzip) --stdout $^ > $@
|
||||||
|
|
||||||
install: all notmuch.1.gz
|
install: all notmuch.1.gz
|
||||||
for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 ; \
|
for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/lib/ \
|
||||||
|
$(DESTDIR)$(prefix)/include/ $(DESTDIR)$(prefix)/share/man/man1 ; \
|
||||||
do \
|
do \
|
||||||
install -d $$d ; \
|
install -d $$d ; \
|
||||||
done ;
|
done ;
|
||||||
install notmuch $(DESTDIR)$(prefix)/bin/
|
install notmuch $(DESTDIR)$(prefix)/bin/
|
||||||
|
install lib/$(SONAME) $(DESTDIR)$(prefix)/lib/
|
||||||
|
install lib/notmuch.h $(DESTDIR)$(prefix)/include/
|
||||||
|
ln -sf $(SONAME) $(DESTDIR)$(prefix)/lib/libnotmuch.so
|
||||||
install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
|
install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
|
||||||
ifeq ($(MAKECMDGOALS), install)
|
ifeq ($(MAKECMDGOALS), install)
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
dir := lib
|
dir := lib
|
||||||
extra_cflags += -I$(dir)
|
extra_cflags += -I$(dir) -fPIC
|
||||||
|
|
||||||
libnotmuch_c_srcs = \
|
libnotmuch_c_srcs = \
|
||||||
$(dir)/libsha1.c \
|
$(dir)/libsha1.c \
|
||||||
|
@ -18,8 +18,9 @@ libnotmuch_cxx_srcs = \
|
||||||
$(dir)/thread.cc
|
$(dir)/thread.cc
|
||||||
|
|
||||||
libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
|
libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
|
||||||
$(dir)/notmuch.a: $(libnotmuch_modules)
|
$(dir)/libnotmuch.so : $(libnotmuch_modules)
|
||||||
$(call quiet,AR) rcs $@ $^
|
$(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -shared -Wl,-soname=$(SONAME) -o $@
|
||||||
|
ln -sf $(SONAME) $@
|
||||||
|
|
||||||
SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
|
SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
|
||||||
CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.a
|
CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/libnotmuch.so *.so
|
||||||
|
|
Loading…
Reference in a new issue