mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-03-25 17:05:13 +01:00
The idea here is that every Makefile at each lower level will be an identical, tiny file that simply defers to a top-level make. Meanwhile, the Makefile.local file at each level is a Makefile snippet to be included at the top-level into a large, flat Makefile. As such, it needs to define its rules with the entire relative directory to each file, (typically in $(dir)). The local files can also append to variables such as SRCS and CLEAN for files to be analyzed for dependencies and to be cleaned.
32 lines
890 B
Makefile
32 lines
890 B
Makefile
WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum
|
|
|
|
NOTMUCH_DEPENDS_FLAGS=-I./lib `pkg-config --cflags glib-2.0 gmime-2.4 talloc`
|
|
NOTMUCH_CXX_DEPENDS_FLAGS=$(NOTMUCH_DEPENDS_FLAGS) `xapian-config --cxxflags`
|
|
|
|
NOTMUCH_CFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_DEPENDS_FLAGS)
|
|
NOTMUCH_CXXFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_CXX_DEPENDS_FLAGS)
|
|
|
|
NOTMUCH_LDFLAGS=`pkg-config --libs glib-2.0 gmime-2.4 talloc` \
|
|
`xapian-config --libs`
|
|
|
|
# Include our local Makfile.local first so that its first target is default
|
|
include Makefile.local
|
|
include lib/Makefile.local
|
|
|
|
%.o: %.cc
|
|
$(CXX) -c $(CFLAGS) $(CXXFLAGS) $(NOTMUCH_CXXFLAGS) $< -o $@
|
|
|
|
%.o: %.c
|
|
$(CC) -c $(CFLAGS) $(NOTMUCH_CFLAGS) $< -o $@
|
|
|
|
.depends: $(SRCS)
|
|
$(CXX) -M $(CPPFLAGS) $(NOTMUCH_DEPENDS_FLAGS) \
|
|
$(NOTMUCH_CXX_DEPENDS_FLAGS) $^ > $@
|
|
-include .depends
|
|
|
|
CLEAN := $(CLEAN) .depends
|
|
|
|
clean:
|
|
rm -f $(CLEAN)
|
|
|
|
|