From 9979b998666f839e0bbc11fff8265b6462bea799 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 10 Mar 2010 16:32:27 -0800 Subject: [PATCH] lib: Compile getdate source code and include it in notmuch.a We're not actually *using* the getdate source for anything yet, but this should at least get things integrated nicely into our build system. Again, these Makefile tweaks once again pushed me into fixing some Makefile assignments with "=" to instead use ":=". --- Makefile | 2 +- lib/Makefile.local | 8 ++++---- lib/getdate/.gitignore | 1 + lib/getdate/Makefile | 7 +++++++ lib/getdate/Makefile.local | 13 +++++++++++++ 5 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 lib/getdate/.gitignore create mode 100644 lib/getdate/Makefile create mode 100644 lib/getdate/Makefile.local diff --git a/Makefile b/Makefile index 46f001ce..4c71cb8f 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ Makefile.config: configure @echo "" ./configure -subdirs = compat emacs lib +subdirs = compat emacs lib/getdate lib global_deps = Makefile Makefile.config Makefile.local \ $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local) diff --git a/lib/Makefile.local b/lib/Makefile.local index 495b27e0..5dc4f634 100644 --- a/lib/Makefile.local +++ b/lib/Makefile.local @@ -1,7 +1,7 @@ dir := lib extra_cflags += -I$(dir) -libnotmuch_c_srcs = \ +libnotmuch_c_srcs := \ $(dir)/libsha1.c \ $(dir)/message-file.c \ $(dir)/messages.c \ @@ -9,7 +9,7 @@ libnotmuch_c_srcs = \ $(dir)/tags.c \ $(dir)/xutil.c -libnotmuch_cxx_srcs = \ +libnotmuch_cxx_srcs := \ $(dir)/database.cc \ $(dir)/directory.cc \ $(dir)/index.cc \ @@ -17,8 +17,8 @@ libnotmuch_cxx_srcs = \ $(dir)/query.cc \ $(dir)/thread.cc -libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o) -$(dir)/notmuch.a: $(libnotmuch_modules) +libnotmuch_modules := $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o) +$(dir)/notmuch.a: $(libnotmuch_modules) $(getdate_modules) $(call quiet,AR) rcs $@ $^ SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs) diff --git a/lib/getdate/.gitignore b/lib/getdate/.gitignore new file mode 100644 index 00000000..879f4c66 --- /dev/null +++ b/lib/getdate/.gitignore @@ -0,0 +1 @@ +/getdate.c diff --git a/lib/getdate/Makefile b/lib/getdate/Makefile new file mode 100644 index 00000000..3b360feb --- /dev/null +++ b/lib/getdate/Makefile @@ -0,0 +1,7 @@ +# See Makfefile.local for the list of files to be compiled in this +# directory. +all: + $(MAKE) -C ../.. all + +.DEFAULT: + $(MAKE) -C ../.. $@ diff --git a/lib/getdate/Makefile.local b/lib/getdate/Makefile.local new file mode 100644 index 00000000..363cb3cd --- /dev/null +++ b/lib/getdate/Makefile.local @@ -0,0 +1,13 @@ +dir := lib/getdate +extra_cflags += -I$(dir) + +getdate_c_srcs := \ + $(dir)/c-ctype.c \ + $(dir)/getdate.c \ + $(dir)/xalloc-die.c \ + $(dir)/xmalloc.c + +getdate_modules := $(getdate_c_srcs:.c=.o) + +SRCS := $(SRCS) $(getdate_c_srcs) +CLEAN := $(CLEAN) $(getdate_modules) $(dir)/getdate.c -- git format-patch -1 --stdout -C 9979b998666f839e0bbc11fff8265b6462bea799