To write an Elementary app, you can get started with the following: More...
To write an Elementary app, you can get started with the following:
To use autotools (which helps in many ways in the long run, like being able to immediately create releases of your software directly from your tree and ensure everything needed to build it is there) you will need a configure.ac, Makefile.am and autogen.sh file.
configure.ac:
Makefile.am:
autogen.sh:
To generate all the things needed to bootstrap just run:
This will generate Makefile.in's, the configure script and everything else. After this it works like all normal autotools projects:
Note sudo was assumed to get root permissions, as this would install in /usr/local which is system-owned. Use any way you like to gain root, or specify a different prefix with configure:
Also remember that autotools buys you some useful commands like:
This uninstalls the software after it was installed with "make install". It is very useful to clear up what you built if you wish to clean the system.
This firstly checks if your build tree is "clean" and ready for distribution. It also builds a tarball (myapp-0.0.0.tar.gz) that is ready to upload and distribute to the world, that contains the generated Makefile.in's and configure script. The users do not need to run autogen.sh - just configure and on. They don't need autotools installed. This tarball also builds cleanly, has all the sources it needs to build included (that is sources for your application, not libraries it depends on like Elementary). It builds cleanly in a buildroot and does not contain any files that are temporarily generated like binaries and other build-generated files, so the tarball is clean, and no need to worry about cleaning up your tree before packaging.
This cleans up all build files (binaries, objects etc.) from the tree.
This cleans out all files from the build and from configure's output too.
This deletes all the files autogen.sh will produce so the tree is clean to be put into a revision-control system (like CVS, SVN or GIT for example).
There is a more advanced way of making use of the quicklaunch infrastructure in Elementary (which will not be covered here due to its more advanced nature).
Now let's actually create an interactive "Hello World" gui that you can click the ok button to exit. It's more code because this now does something much more significant, but it's still very simple: