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 ":=".
@echo ""
./configure
-subdirs = compat emacs lib
+subdirs = compat emacs lib/getdate lib
global_deps = Makefile Makefile.config Makefile.local \
$(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local)
dir := lib
extra_cflags += -I$(dir)
-libnotmuch_c_srcs = \
+libnotmuch_c_srcs := \
$(dir)/libsha1.c \
$(dir)/message-file.c \
$(dir)/messages.c \
$(dir)/tags.c \
$(dir)/xutil.c
-libnotmuch_cxx_srcs = \
+libnotmuch_cxx_srcs := \
$(dir)/database.cc \
$(dir)/directory.cc \
$(dir)/index.cc \
$(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)
--- /dev/null
+/getdate.c
--- /dev/null
+# See Makfefile.local for the list of files to be compiled in this
+# directory.
+all:
+ $(MAKE) -C ../.. all
+
+.DEFAULT:
+ $(MAKE) -C ../.. $@
--- /dev/null
+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