SV_DIR=/home/moa/projects/savane
SV_CONF=/etc/savannah
SV_CONF_INTERACTIVE=yes
SV_BIN=/usr/local/bin
PERL_INC=/usr/local/lib/site_perl
INSTALLNLSDIR=/usr/share/locale
SV_URLROOT=/savannah
SV_DB=mysql
SV_DB_NAME=savannah
SV_DB_CMD=mysql
SV_DB_OPTIONS=
MM_CGI_DIR=
WWW_SERVER_USER=www-data
 
BASE_CONF_COMMAND=backend/install/sv_update_conf.pl --recreate --http-user=$(WWW_SERVER_USER) --conffile=$(SV_CONF)/savannah.conf --default-domain=`hostname -f` --topdir=`pwd` --url-topdir=$(SV_URLROOT) --incdir=\$$sys_topdir/etc/site-specific-content

all: update-path
	if [ ! -e www ]; then ln -s frontend/php www; fi
	cd po && make
	cd db && make

reset:
	make reset-path

cache:
	@echo "This feature no longer present"

docs:
	cd doc && make docs
	ln -sf ../../doc/admin/savannah.html frontend/php/savannah.html

icons:
	cd frontend/php/images && make icons

clean: reset-path
	cd lib && make clean
	cd backend && make clean
	cd po && make clean
	cd frontend/php/css && make clean
#	cd doc && make -i clean
	find . \( -name "Makefile" -or -name "#*#" -or -name ".#*" -or -name "*~" -or -name ".*~" \) -exec rm -rfv {} \;
	rm -fv *.cache

conf:
	if [ $(SV_CONF_INTERACTIVE) == "yes" ] ; then $(BASE_CONF_COMMAND) ; else $(BASE_CONF_COMMAND) --non-interactive ; fi
	make update-path

local.inc: conf

database: database-structure database-initvalues

database-structure:
	cd db && make create-db init-structure

database-initvalues:
	cd db && make init-values

update-path:
	cd lib && make update-path
	cd frontend/php/css && make update-path

reset-path:
	cd lib && make reset-path
	cd frontend/php/css && make reset-path

update-conf:
	backend/install/sv_update_conf.pl --update --conffile=$(SV_CONF)/savannah.conf
	make update-path

update:
	cvs update -d
	./configure
	make
	make update-conf
	make install -i
	sv_skill

install: all
	cd etc && make install
	cd backend && make install
	cd lib && make install
	cd po && make install


uninstall: 
	cd backend && make uninstall
	cd lib && make uninstall
	cd po && make uninstall
