aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/guide/app.asciidoc
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <[email protected]>2015-09-02 19:27:04 +0200
committerLoïc Hoguin <[email protected]>2015-09-02 22:47:20 +0200
commit991fbe07e1a47a182023cd9522016775c67a6e0d (patch)
treeaad774bd88387eb93a5979f834fc5a441eab40eb /doc/src/guide/app.asciidoc
parentbdfcb324f780c90de199b908837875dfc9b2e439 (diff)
downloaderlang.mk-991fbe07e1a47a182023cd9522016775c67a6e0d.tar.gz
erlang.mk-991fbe07e1a47a182023cd9522016775c67a6e0d.tar.bz2
erlang.mk-991fbe07e1a47a182023cd9522016775c67a6e0d.zip
app.asciidoc: Document how to handle generated source files
Diffstat (limited to 'doc/src/guide/app.asciidoc')
-rw-r--r--doc/src/guide/app.asciidoc23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/src/guide/app.asciidoc b/doc/src/guide/app.asciidoc
index 880221a..a04c5a9 100644
--- a/doc/src/guide/app.asciidoc
+++ b/doc/src/guide/app.asciidoc
@@ -235,6 +235,29 @@ transforms have changed. Erlang.mk also automatically keeps
track of which files should be compiled first, for example
when you have behaviors used by other modules in your project.
+=== Generated source files ===
+
+Generated source files are supported: they should be listed as
+dependencies to `$(PROJECT).d`:
+
+[source,make]
+----
+PROJECT = example
+
+.DEFAULT_GOAL = all
+
+$(PROJECT).d:: src/generated_mod.erl
+
+include erlang.mk
+
+src/generated_mod.erl::
+ $(gen_verbose) ./gen-mod.sh $@
+----
+
+Note how `.DEFAULT_GOAL` is set to `all` near the beginning. Without
+this, `$(PROJECT).d` would become the default target, changing the
+expected behavior of this `Makefile`.
+
=== Cleaning
Building typically involves creating a lot of new files. Some