################################################################
# Start User Configuration

# Installation Directories:
# The following variables indicate, where the news cache should 
# be installed. Don't forget to define the server root directory
# in Configure.h.

PREFIX=$(HOME)/lib/newscache
BINDIR=$(PREFIX)/bin
ETCDIR=$(PREFIX)/etc
MANDIR=$(PREFIX)/man

#Assertions:
#You may define -DASSERT_ON to include or -DASSERT_OFF
#to exclude assertions. Assertiions perform some consistency checks
#at certain points and terminate the program if inconsistencies 
#are being found. While this library is still in its beta stage
#and if performance is not a concern we recommend to use -DASSERT_ON
ASSERT=-DASSERT_ON

#Verbosity:
#The News Cache includes its own logger class. So we recommend
#to use -DVERB_ON here. This logs several types of messages to 
#a log file.
VERBOSITY=-DVERB_ON

#Other Debug switches:
#Define other debug switches here. Eg. -g
ODEBUG=-g

#Optimization:
#Please do not compile using optimization unless you know
#what you are doing! gcc up to V2.7.2.2 has many bugs in the
#c++ optimization part!

# End User Configuration
################################################################
export PREFIX BINDIR ETCDIR MANDIR

# Debug-Flags
# TRACE_ON
#   allows tracing of executed functions
# DEBUG_ON
#   gives some Debug output

DEBUG=$(ODEBUG) $(ASSERT) $(VERBOSITY)
GINCLUDE=
GCXXFLAGS=-Wall -Wno-unused -fhandle-exceptions

export GINCLUDE GCXXFLAGS DEBUG

all: nvclasses nserver cache

depend:
	make -C NVClasses-0.6 depend
	make -C lib depend
	make -C src depend

nvclasses:
	make -C NVClasses-0.6 all

nserver:
	make -C lib all

cache:
	make -C src all

install:
	@ make -C src install
	@ make -C man install
	install -d $(ETCDIR)
	@ echo '*';\
	echo '* Please copy etc/newscache.conf to $(ETCDIR)';\
	echo '* and modify it for your needs.';\
	echo '*'

clean:
	make -C NVClasses-0.6 clean
	make -C lib clean
	make -C src clean
	rm -f debug Trace* core

mrproper:
	make -C NVClasses-0.6 clean
	make -C lib clean
	make -C src clean
	rm -f debug Trace* core
