Hi!

This is just a template for a kde app. The original version was written by
Janos Farkas. 

This is my own application khexdit, that I mainly developed to show some
general principes. If you find it useful, the current version you can
find in kdeutils ;)

I have readded automake to show everybody, how easy it is to use automake.
If you can't get the basics, feel free to use autoconf only, but autoconf
is a must! You should be able to write a Makefile.am without knowing all
the details. 
You need autoconf-2.12 and automake-1.2 or higher.

The rules: -don't hardcode any paths
           -don't hardcode programs
           -use only one subdir named like your app

the features: 

you can use several programs :
	@CC@ for C-compiler
	@CXX@ for C++-compiler (don't use CC!)
	@INSTALL@ for compatible install
	@MOC@ for moc

you can use several predefined flags :
	@CXXFLAGS@ is set to "-g -Wall" or "-O2 -Wall"
	@LDFLAGS@ is set to "-s" by default for striping
	@all_libraries@ is set to all needed libraries for compiling KDE
	@all_includes@ is set to all needed include paths 
	
Don't use QTDIR and KDEDIR, please use @all_includes@ and @all_libraries@
and the kde_ paths for installing.

The available paths are:
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.      

The main idea is to use this aliases to keep something like an abstraction
layer in the Makefiles. This makes it possible to change this directories
somewhere in the future without changing every single Makefile.

I've added a Makefile.in.temp. This is the way, you should write your
Makefile.in, if it's not possible to use automake for you. I would suggest
to everybody to use automake, since you get dependency checking for free ;)
On this, you can just work like on a normal Makefile

When you want to release your package, just 'make distclean',this will 
remove all files, that are not needed.

Some rules about good Makefiles:

- Don't use autoconf macros as it. Add a line "MOC = @MOC@" for example
  and use $(MOC) instead. automake creates this lines for you automaticly.

- split binaries and datas within the "make install" process. Use
  "install-exec" and "install-data" for this and add a 
  "install: install-exec install-data" in your Makefile.in. automake does
  this automaticly

- paths, that you use more then once, assign to a variable and use this one.
  This allows you to change the value very fast.

- add the libraries in the order of highest to lowest dependency. This means
  in the order kfm/khtmlw, kdeui, kdecore, qt, X11/Xext, others (jpeg, gif, m)
  
- remove all the files, you create at least while making "distclean". What
  you do while "make clean", is up to you. But in "make distclean", every-
  thing must be gone (including the created Makefile)

- add a uninstall target and remove everything, that you have installed.
  Don't remove directories, just remove the files.

- keep files, that you other guys (translator) change away from your
  sources. 

- everything, I have forgotten


A chapter about KLocale:

Klocale is a class in libkdecore, that allows you to internationalizate
messages (only messsages currently). For this add a klocale->translate
to all messages, that needs to be translated. 
After that do a "xgettext -C -ktranslate <your_sources>". xgettext is
part of GNU gettext (that stands behind KLocale). This will create a
file messages.po in your directory. Some messages are already defined
in kde.po (part of kdelibs). You can remove this one, if you don't need
a different translation for them. 
BUT: be aware, that the contents of a word differs from language to
language. For example in italian the word for low depends on the word,
you want to decrease.

After you have done this, the best way is to mail this messages.po file
to me. Since I'm the coordinator of the KDE Internationalization Project
(cool name, but it's just me and the translators ;), I may help you with
finding translations.

The reason, why I added khexdit and not a khello or something is very
simple. For khexdit there are a lot of translations, so I wanted to 
demonstrate, how strong the concept is. Just try to export LANG=fr for
example before starting khexdit.


I have added Makefile.dist to the distribution. You may want to look at
it to find out, how to create the autoconf/automake files.

OK. If you have further questions or problems with this package, contact
me.


Stephan Kulow (coolo@kde.org)
07. Oct 1997
