[Geany] Automated makefile

Andrew Janke a.janke at xxxxx
Thu May 28 23:50:31 UTC 2009


Hi Nicolas,

On Thu, May 28, 2009 at 18:49, Nicolas Hillegeer
<nicolashillegeer at gmail.com> wrote:
> I've been searching the web for some time (including these lists), and I'm
> sorry if I've missed it, but is there any feature?


I haven't been following this thread much but surely it would be daft
to re-invent the wheel inside geany for this when there is already
cmake, genmake, and of course my favourite automake/autoconf the
venerable old dinosaurs that they are. Surely such a thing in geany
would just call an external script (of some description, perl? python?
bash?) that created the Makefile.am and configure.ac and then called
the appropriate things.

ie:   (replace all the things in <>)

For Makefile.am:

-----
AUTOMAKE_OPTIONS = check-news
ACLOCAL_AMFLAGS = -I m4

bin_PROGRAMS = <program_name>
dist_man1_MANS = <man pages>

<program_name>_SOURCES = <headers.h sourcefiles.c sourcefiles.cxx>
-----

for configure.ac

----
# Require autoconf 2.57 or newer.
AC_PREREQ([2.57])

AC_INIT([<program_name>],[<version>],[<username>])
AC_CONFIG_SRCDIR([<first source file.c>])

AM_INIT_AUTOMAKE

# The argument is the name of the generated header file.
# It is recommended to leave it as "config.h".
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL

# Finish up by writing output files.
AC_CONFIG_FILES([Makefile])
----

Then all you have to do is call these:

   aclocal -I m4
   autoheader
   automake --add-missing --copy
   autoreconf

and from there:

   configure
   make

I am sure there are (simpler) recipes for doing this with cmake and
the likes, but this is what I do for GNU style projects that I want to
have build cross-platform.



--
Andrew Janke
(a.janke at gmail.com || http://a.janke.googlepages.com/)
Canberra->Australia    +61 (402) 700 883



More information about the Users mailing list