SUBDIRS = kvideoio libkdetv plugins clients

.PHONY:	snapshot release changes svnchanges kdetv-clean

snapshot: changes kdetv-clean
	export UNSERMAKE=no
	cd ../../../; svn2dist -d extragear/multimedia kdetv -v svn`date +%G%m%d` --no-gzip

release: changes kdetv-clean
	export UNSERMAKE=no
	cd ../../../; svn2dist -d extragear/multimedia kdetv -v `cat extragear/multimedia/kdetv/kdetv_version.h | grep KDETV_VERSION | sed "s/.*\"\(.*\)\"/\\1/"` --no-gzip

rpm:
	sudo bash -c "rpm -ba --target=i686 packaging/rpm/kdetv.spec"

#TODO: Ignore *.desktop
changes:
	@echo "Creating changelog. This may take some time..."
	svn log --xml | xsltproc ~/development/svn2cl.xsl - > ChangeLog

svnchanges:	changes
	svn commit -m 'CVS_SILENT update changelog' ChangeLog

kdetv-clean:
	-cd ..; find -name *~ | xargs rm -f
	-cd ..; find -name svn-commit* | xargs rm -f

messages: rc.cpp
	$(EXTRACTRC) `find . -name "*.rc" -o -name "*.ui"` > rc.cpp
	cd clients/kdetv; $(PREPARETIPS) > tips.cpp
	LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
	if test -n "$$LIST"; then \
		 $(XGETTEXT) $$LIST -o $(podir)/kdetv.pot; \
	fi
	rm -f clients/kdetv/tips.cpp 
	rm -f rc.cpp
