]> git.cworth.org Git - obsolete/notmuch-old/commitdiff
lib: Compile getdate source code and include it in notmuch.a getdate
authorCarl Worth <cworth@cworth.org>
Thu, 11 Mar 2010 00:32:27 +0000 (16:32 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 11 Mar 2010 00:53:19 +0000 (16:53 -0800)
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
lib/Makefile.local
lib/getdate/.gitignore [new file with mode: 0644]
lib/getdate/Makefile [new file with mode: 0644]
lib/getdate/Makefile.local [new file with mode: 0644]

index 46f001ce2fa5d2523ff08c577b4aadbecae853fa..4c71cb8fd0a956f8784651a33192aee02e06e5e1 100644 (file)
--- 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)
index 495b27e06eebd225fdf3958d219103e6ac2cd208..5dc4f634a183feb96a959fc1b5d8d6743d19f353 100644 (file)
@@ -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 (file)
index 0000000..879f4c6
--- /dev/null
@@ -0,0 +1 @@
+/getdate.c
diff --git a/lib/getdate/Makefile b/lib/getdate/Makefile
new file mode 100644 (file)
index 0000000..3b360fe
--- /dev/null
@@ -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 (file)
index 0000000..363cb3c
--- /dev/null
@@ -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