#$Id: Makefile,v 1.9 2006/08/20 16:39:04 jwrobel Exp $

include ../common.mk
include ../$(PLATFORM).mk

OBJ_PREFIXES = Error Rule RulesParser Rules Test str_search acsmx\
		ActiveRuleSet

LINK = $(OBJS) $(PCRE_STATIC_LIB)

SUBDIRS = 

.PHONY: $(SUBDIRS) all clean dep clean_cover test deploy-tests gentests 

INCLUDES = 
ifdef PCRE_HEADERS_PATH
	INCLUDES += -I$(PCRE_HEADERS_PATH)
endif

all: $(SUBDIRS) dep Test 

Test: $(OBJS)
	$(TEST_LINK_CMD) $(LINK)

$(OBJS): 
	$(CC) $(INCLUDES) $(CPPFLAGS) -c $(@:.$(OBJ_SUFFIX)=.cpp)

$(SUBDIRS):
	$(MAKE) -C $@

clean_cover:
	find . \( -name '*.da' -o -name '*.gcov' \) -type f|xargs rm -f;

clean: clean_cover
	$(CLEAN_CMD)

gentests:
	cd tests; ./gentests.py; 	

deploy-tests: gentests
	cp ./tests/test* ../../../www/tests;
	cd ../../../www/tests; cvs add test_*; cvs commit -m "web test updated";

test: all gentests
	./Test test.rules tests/test* 2>&1 |grep -w "^Test";


include ../gendepend.mk


