#!/usr/bin/make -f

# this script helps building when you're developing
# for gideon on a debian system.

# it shows how to config and install gideon in /usr/local/kde

# first do one of the following:
# [for QT on X]
# $ debian/build-gideon config
# [for QT embedded]
# $ debian/build-gideon config2
# [for Qtopia]
# $ debian/build-gideon config3
# and then
# $ make
# you can then use run or debug targets

default: install

debdir=$(shell pwd)/debian
instdir=$(debdir)/tmp

-include debian/debianrules

run:
	LD_LIBRARY_PATH=/usr/local/kde3/lib /usr/local/kde3/bin/gideon

debug:
	LD_LIBRARY_PATH=/usr/local/kde3/lib kdbg /usr/local/kde3/bin/gideon

debian/debiandirs: admin/debianrules
	DEB_BUILD_OPTIONS=debug perl -w admin/debianrules echodirs > debian/debiandirs

config: debian/debiandirs
	if test ! -f configure; then \
	  $(MAKE) -f admin/Makefile.common ;\
	fi
	./configure $(configkdevelop) --prefix=/usr/local/kde3 \
	--with-kdelibsdoxy-dir=/usr/share/doc/kde/HTML/en/kdelibs-apidocs \
	--with-phpdocdir=/usr/share/doc/php4 \
	--with-glibdocdir=/usr/share/doc/glib-reference/html \
	--with-gdkdocdir=/usr/share/doc/gtk-reference/gdk/html \
	--with-gtkdocdir=/usr/share/doc/gtk-reference/gtk/html \
	--with-gnomedocdir=/usr/share/doc/gnome-dev-doc/html \
	--enable-javasupport \
	--enable-svnsupport

	touch configure-stamp

config2: debian/debiandirs
	if test ! -f configure; then \
	  $(MAKE) -f admin/Makefile.common ;\
	fi
	./configure $(configkdevelop) \
	--with-kdelibsdoxy-dir=/usr/share/doc/kde/HTML/en/kdelibs-apidocs \
	--with-phpdocdir=/usr/share/doc/php4 \
	--with-glibdocdir=/usr/share/doc/glib-reference/html \
	--with-gdkdocdir=/usr/share/doc/gtk-reference/gdk/html \
	--with-gtkdocdir=/usr/share/doc/gtk-reference/gtk/html \
	--with-gnomedocdir=/usr/share/doc/gnome-dev-doc/html \
	--enable-javasupport \
	--enable-svnsupport \
	--enable-embedded

	touch configure-stamp

config3: debian/debiandirs
	if test ! -f configure; then \
	  $(MAKE) -f admin/Makefile.common ;\
	fi
	./configure $(configkdevelop) \
	--with-kdelibsdoxy-dir=/usr/share/doc/kde/HTML/en/kdelibs-apidocs \
	--with-phpdocdir=/usr/share/doc/php4 \
	--with-glibdocdir=/usr/share/doc/glib-reference/html \
	--with-gdkdocdir=/usr/share/doc/gtk-reference/gdk/html \
	--with-gtkdocdir=/usr/share/doc/gtk-reference/gtk/html \
	--with-gnomedocdir=/usr/share/doc/gnome-dev-doc/html \
	--enable-javasupport \
	--enable-svnsupport \
	--enable-qtopia

	touch configure-stamp

configure-stamp:
	@echo "*** You must first run debian/build-gideon config  (for X) or"
	@echo "***                    debian/build-gideon config2 (for QT embedded) or"
	@echo "***                    debian/build-gideon config3 (for Qtopia)"

build: configure-stamp
	$(MAKE)

clean:
	rm -f configure-stamp
	-make distclean

install: build
	make install

.PHONY: build clean install run debug
