<feed xmlns='http://www.w3.org/2005/Atom'>
<title>erlang.mk.git/templates/apps_Makefile, branch master</title>
<subtitle>A build tool for Erlang that just works.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/erlang.mk.git/'/>
<entry>
<title>Move templates outside the source .mk files</title>
<updated>2024-11-22T13:47:20+00:00</updated>
<author>
<name>Loïc Hoguin</name>
<email>essen@ninenines.eu</email>
</author>
<published>2024-11-21T14:55:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/erlang.mk.git/commit/?id=a6f9a450af99a7a95848dde671de658bb53a43dc'/>
<id>a6f9a450af99a7a95848dde671de658bb53a43dc</id>
<content type='text'>
Templates now no longer use Make variables for substitution
but instead replace strings with their equivalent:

  template_name: Corresponds to n=template_name
  project_name:  Corresponds to $(PROJECT) or in=project_name

This allows defining templates outside of Makefiles. For
example an external plugin could define their templates
in templates/my_template.erl and then have the following
in the included Makefile:

  tpl_my_template = $(file &lt; $(THIS)/templates/my_template.erl)

By default the created file will be in src/template_name.erl.
This can be overriden with the tplp_* variable:

  tplp_my_template = src/model/my_template.erl

Substitution is applied both to the template contents and
to its path.

In addition, attempting to overwrite an existing file when
creating a template will result in failure.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Templates now no longer use Make variables for substitution
but instead replace strings with their equivalent:

  template_name: Corresponds to n=template_name
  project_name:  Corresponds to $(PROJECT) or in=project_name

This allows defining templates outside of Makefiles. For
example an external plugin could define their templates
in templates/my_template.erl and then have the following
in the included Makefile:

  tpl_my_template = $(file &lt; $(THIS)/templates/my_template.erl)

By default the created file will be in src/template_name.erl.
This can be overriden with the tplp_* variable:

  tplp_my_template = src/model/my_template.erl

Substitution is applied both to the template contents and
to its path.

In addition, attempting to overwrite an existing file when
creating a template will result in failure.
</pre>
</div>
</content>
</entry>
</feed>
