
# release, debug
boost_rel = debug
boost_ptr = build/*.a/*/$(boost_rel)/threading-multi

all:

deb:
	test -d boost || { echo "need boost source under ./boost"; exit 1; }
	#make genboost
	test -f boost/xlibs/libboost_program_options.a || { \
		echo "boost not built"; exit 1; }
	test -f boost/xlibs/libboost_filesystem.a || { \
		echo "boost not built"; exit 1; }
	yada rebuild
	debuild -us -uc -b

clean distclean:
	make -C cool $@
	make -C plproxy $@

genboost:
	rm -f boost/xlibs/*
	cd boost && ( \
	  ./configure --with-libraries=filesystem,program_options && \
	  make && \
	  mkdir -p xlibs && \
	  cp bin/boost/libs/filesystem/$(boost_ptr)/*.a \
	  	xlibs/libboost_filesystem.a && \
	  cp bin/boost/libs/program_options/$(boost_ptr)/*.a \
	  	xlibs/libboost_program_options.a \
	)

fullclean:
	-make clean
	-make distclean
	rm -rf ./plproxy/autom4te.cache
	rm -rf debian/build* debian/control debian/rules debian/packages-tmp*
	rm -rf debian/subst* debian/tmp-* debian/files
	find . -name .libs -o -name .deps | xargs rm -rf
	find . -name '*.[ao]' -o -name '*.l[ao]' -o -name '.#*' | xargs rm -f

tgz:
	make fullclean
	cd .. && tar cvzf plproxy-`date +%Y-%m-%d`.tgz --exclude CVS plproxy


