
# this 10 paths are KDE specific. Use them:
# kde_htmldir       Where your docs should go to. (contains lang subdirs)
# kde_appsdir       Where your application file (.kdelnk) should go to. 
# kde_icondir       Where your icon should go to.
# kde_minidir       Where your mini icon should go to.
# kde_datadir       Where you install application data. (Use a subdir)
# kde_locale        Where translation files should go to.(contains lang subdirs)
# kde_cgidir        Where cgi-bin executables should go to.
# kde_confdir       Where config files should go to.
# kde_mimedir       Where mimetypes should go to.
# kde_toolbardir    Where general toolbar icons should go to.
# kde_wallpaperdir  Where general wallpapers should go to.

# just set the variable
APPSDIR = $(kde_appsdir)/Utilities
# set the include path for X, qt and KDE
INCLUDES= @all_includes@
# claim, which subdirectories you want to install
SUBDIRS = doc

bin_PROGRAMS = 	klpq

# Which sources should be compiled for klpq.
klpq_SOURCES	= main.cpp klpq.cpp ConfAutoUpdate.cpp ConfAutoUpdateData.cpp \
krowtable.cpp kheader.cpp queueview.cpp klpqspooler.cpp FirstStart.cpp FirstStartData.cpp \
SpoolerConfig.cpp SpoolerConfigData.cpp

# the library search path
klpq_LDFLAGS = $(all_libraries) $(KDE_RPATH)

# the libraries to link against. Be aware of the order. First the libraries,
# that depend on the following ones.
klpq_LDADD   = -lkfm -lkdeui -lkdecore -lqt -lX11 -lXext @LIBSOCKET@

# this option you can leave out. Just, if you use "make dist", you need it
#noinst_HEADERS = 

# just to make sure, automake makes them 
BUILTSOURCES =	klpq.moc ConfAutoUpdate.moc krowtable.moc \
kheader.moc queueview.moc FirstStart.moc FirstStartData.moc \
SpoolerConfig.moc SpoolerConfigData.moc

# if you "make distclean", this files get removed. If you want to remove
# them while "make clean", use CLEANFILES
DISTCLEANFILES = $(BUILTSOURCES)

# make messages.po. Move this one to ../po/ and "make merge" in po
messages:
	$(XGETTEXT) -C -ktranslate $(klpq_SOURCES) && mv messages.po ../po/klpq.pot

# just install datas here. Use install-exec-data for scripts and etc.
# the binary itself is already installed from automake
# use mkinstalldirs, not "install -d"
# don't install a list of file. Just one file per install.
# if you have more of them, create a subdirectory with an extra Makefile 
install-data-local: 
	$(mkinstalldirs) $(APPSDIR)
	$(INSTALL_DATA) KLpq.kdelnk $(APPSDIR)
	$(mkinstalldirs) $(kde_icondir)
	$(mkinstalldirs) $(kde_minidir)

# remove ALL you have installed in install-data-local or install-exec-local
uninstall-local:
	-rm -f $(APPSDIR)/KLpq.kdelnk

# add a dependency for every moc file to be full portable
# I've added a key binding to emacs for this. 
klpq.cpp: klpq.moc
klpq.moc: klpq.h
	$(MOC) klpq.h -o klpq.moc

ConfAutoUpdate.cpp: ConfAutoUpdate.moc
ConfAutoUpdate.moc: ConfAutoUpdate.h
	$(MOC) ConfAutoUpdate.h -o ConfAutoUpdate.moc

krowtable.cpp: krowtable.moc
krowtable.moc: krowtable.h
	$(MOC) krowtable.h -o krowtable.moc

kheader.cpp: kheader.moc
kheader.moc: kheader.h
	$(MOC) kheader.h -o kheader.moc

queueview.cpp: queueview.moc
queueview.moc: queueview.h
	$(MOC) queueview.h -o queueview.moc

FirstStart.cpp: FirstStart.moc
FirstStart.moc: FirstStart.h
	$(MOC) FirstStart.h -o FirstStart.moc

FirstStartData.cpp: FirstStartData.moc
FirstStartData.moc: FirstStartData.h
	$(MOC) FirstStartData.h -o FirstStartData.moc

SpoolerConfig.cpp: SpoolerConfig.moc
SpoolerConfig.moc: SpoolerConfig.h
	$(MOC) SpoolerConfig.h -o SpoolerConfig.moc

SpoolerConfigData.cpp: SpoolerConfigData.moc
SpoolerConfigData.moc: SpoolerConfigData.h
	$(MOC) SpoolerConfigData.h -o SpoolerConfigData.moc
