<HTML> <HEAD> <!-- This HTML file has been created by texi2html 1.51 from .././gimpprint.texi on 22 January 2003 --> <TITLE>GIMP-Print - automake</TITLE> </HEAD> <BODY> Go to the <A HREF="gimpprint_1.html">first</A>, <A HREF="gimpprint_8.html">previous</A>, <A HREF="gimpprint_10.html">next</A>, <A HREF="gimpprint_47.html">last</A> section, <A HREF="gimpprint_toc.html">table of contents</A>. <P><HR><P> <H2><A NAME="SEC14" HREF="gimpprint_toc.html#TOC14">3.4 @command{automake}</A></H2> <P> <A NAME="IDX12"></A> </P> <P> The @command{automake} program can be used to generate <TT>`Makefile.in'</TT> files suitable for use with a <TT>`configure'</TT> script generated by @command{autoconf}. As @command{automake} <EM>requires</EM> @command{autoconf}, this section will assume the use of a <TT>`configure'</TT> script which uses the <CODE>AM_PATH_GIMPPRINT</CODE> macro (there is little point in <EM>not</EM> using it!). </P> <P> It is highly recommeded that you use GNU @command{autoconf} and @command{automake}. They will allow you to make your software build on most platforms with most compilers. @command{automake} makes writing complex <TT>`Makefile'</TT> files very easy, by expressing how to build your packages in terms of what files are required to build a project and the installation locations of the files. It imposes a few limitations over using plain <TT>`Makefile'</TT> files, such as in the use of conditionals, but these problems are vastly outweighed by the benefits it brings. It also creates many extra targets in the generated <TT>`Makefile.in'</TT> files such as @command{dist}, @command{distcheck}, @command{clean}, @command{distclean}, @command{maintainer-clean} and @command{tags}, and there are many more more available. See Info file `automake', node `Top', for more information. </P> <P> Because <CODE>AM_PATH_GIMPPRINT</CODE> calls <CODE>AC_SUBST</CODE> to substitute @env{GIMPPRINT_CFLAGS}, @env{GIMPPRINT_LIBS} and @env{GIMPPRINT_CONFIG}, @command{automake} will automatically set these variables in the <TT>`Makefile.in'</TT> files it generates, requiring no additional effort on your part! </P> <P> As in previous examples, we will make a program @command{prog} from a file <TT>`prog.c'</TT>. This is how one might build write a <TT>`Makefile.am'</TT> to do this: </P> <PRE> AUTOMAKE_OPTIONS = 1.4 gnu MAINT_CHARSET = latin1 @SET_MAKE@ CFLAGS = @CFLAGS@ INCLUDES = @INCLUDES@ $(GIMPPRINT_CFLAGS) bin_PROGRAMS = prog prog_SOURCES = prog.c prog_LDADD = $(GIMPPRINT_LIBS) MAINTAINERCLEANFILES = Makefile.in </PRE> <P> That's all there is to it! Please note that this example also requires the macro <CODE>AC_PROG_MAKE_SET</CODE> to be used in <TT>`configure.in'</TT> and the use of <CODE>AC_SUBST</CODE> to substitute @env{CFLAGS} and @env{INCLUDES} where <CODE>@CFLAGS@</CODE> and <CODE>@INCLUDES@</CODE> are found in the file, respectively. <P><HR><P> Go to the <A HREF="gimpprint_1.html">first</A>, <A HREF="gimpprint_8.html">previous</A>, <A HREF="gimpprint_10.html">next</A>, <A HREF="gimpprint_47.html">last</A> section, <A HREF="gimpprint_toc.html">table of contents</A>. </BODY> </HTML>