..
    Copyright 2019-2020 - Swiss Data Science Center (SDSC)
    A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
    Eidgenössische Technische Hochschule Zürich (ETHZ).

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

.. _comparison:

How does this compare ...
=========================

There are many tools that can be used for doing your day-to-day work. Renku
is not **a silver bullet** or **a magic wand** for making your results
reproducible.

... to ``Makefile``
-------------------

If you are using ``Makefile`` to generate your :term:`outputs` you are on a
good path. However you might be missing versioning of your past executions.

Renku internally builds rules similar to those defined in a ``Makefile`` and
makes sure that all files are saved before running a :term:`tool`.

Running the following ``renku run`` commands

.. code-block:: console

   $ renku run echo test > foo
   $ renku run wc -c < foo > foo.wc

is equivalent to this simple ``Makefile``.

.. code-block:: Makefile

   foo:
     @echo test > foo

   foo.wc: foo
     @wc -c < foo > foo.wc

Renku also makes sure that if any of the :term:`inputs` are modified only
the necessary "rules" are invoked. In addition, `make` does not run the rule if all
dependencies are older then the targets.

.. code-block:: console

   $ renku run echo second > foo
   $ renku status
   On branch master
   Files generated from newer inputs:
     (use "renku log [<file>...]" to see the full lineage)
     (use "renku update [<file>...]" to generate the file from its latest inputs)

          foo.wc: foo#deadbeef

   $ renku update foo.wc
   $ renku status
   On branch master
   All files were generated from the latest inputs.

.. note::

   As a **bonus** the ``Makefile`` can be generated by running
   ``renku log --format Makefile foo.wc`` command.
