<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA -
 *
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="G_make">
    <refnamediv>
        <refname>G_make</refname>
        <refpurpose>call make or nmake</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>Rfiles=G_make(files,dllname)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>files</term>
                <listitem>
                    <para>a character string or a vector of character string.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>dllname</term>
                <listitem>
                    <para>a character string.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>Rfiles</term>
                <listitem>
                    <para>
                        vector of character string. <literal>Rfiles</literal> can be used as a first argument when calling <literal>addinter</literal> function.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            On Unix like systems <literal>G_make</literal> calls the <literal>make</literal> utility for building target <literal>files</literal>
            and returns the value of <literal>files</literal> in the variable <literal>Rfiles</literal>.
            On windows platforms, <literal>G_make</literal> calls the <literal>nmake</literal> utility for building target <literal>dllname</literal> and it
            returns the value of <literal>dllname</literal> in the variable <literal>Rfiles</literal>.
            Of course <literal>G_make</literal> will work if appropriate Makefiles are
            provided in the current Scilab directory.
        </para>
        <para>
            <literal>G_make</literal> can be used to provide OS independent call to addinter.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
if getos() == 'Windows' then
  txt = ['ex1c.dll:',
         '  @echo ------------------------------------------',
         '  @echo From Makefile.mak',
         '  @echo ------------------------------------------',
         ' '];
  mputl(txt,TMPDIR+'/makefile.mak')
  current_dir = pwd();
  cd TMPDIR
  files=G_make([TMPDIR+'/ex1cI.o',TMPDIR+'/ex1c.o'],'ex1c.dll');// compilation
  //
  //addinter(files,'foobar','foubare'); // link
  cd(current_dir);
end
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="addinter">addinter</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
