# Makefile for the Sherlock Gatherer (c) 2001--2006 Martin Mares <mj@ucw.cz>

DIRS+=gather

ifdef CONFIG_GATHERER

PROGS+=$(o)/gather/gtest $(o)/gather/gbatch
CONFIGS+=gatherer checker checker-filter

LIBGATH_MODS=ginit gobject gconfig charset content gfilter bucket diff ganalyse
LIBGATH_LIBS=-lz $(LIBLANG_LIBS)
LIBGATH_INCLUDES=gather.h

include $(s)/gather/proto/Makefile
include $(s)/gather/format/Makefile

$(o)/gather/libgather.a: $(addsuffix .o,$(addprefix $(o)/gather/,$(LIBGATH_MODS)))
$(o)/gather/libgather.so: $(addsuffix .oo,$(addprefix $(o)/gather/,$(LIBGATH_MODS)))

$(o)/gather/gtest: $(o)/gather/gtest.o $(LIBPARSE) $(LIBPROTO) $(LIBGATH) $(LIBCUSTOM) $(LIBSH)
$(o)/gather/gtest: LIBS+=$(LIBPARSE_LIBS) $(LIBGATH_LIBS)

$(o)/gather/gbatch: $(o)/gather/gbatch.o $(LIBPARSE) $(LIBPROTO) $(LIBGATH) $(LIBCUSTOM) $(LIBSH)
$(o)/gather/gbatch: LIBS+=$(LIBPARSE_LIBS) $(LIBGATH_LIBS)

INCLUDES+=$(o)/gather/.include-stamp
$(o)/gather/.include-stamp: $(addprefix $(s)/gather/,$(LIBGATH_INCLUDES))
	$(s)/build/install-includes $(s)/gather run/include/gather $(?F)
	touch $(o)/gather/.include-stamp

ifdef CONFIG_GATHERD
include $(s)/gather/daemon/Makefile
endif

endif

