updating.asciidoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. [[updating]]
  2. == Updating Erlang.mk
  3. This chapter describes how to update the 'erlang.mk' file
  4. in your repository.
  5. === Initial bootstrap
  6. The first time you use Erlang.mk, it will bootstrap itself.
  7. It always uses the most recent version for this, so you don't
  8. have to update after creating your project.
  9. === Updating
  10. Later on though, updating becomes a necessity. Erlang.mk
  11. developers and contributors relentlessly improve the project
  12. and add new features; it would be a waste not to benefit
  13. from this.
  14. That's why updating Erlang.mk is so simple. All you need
  15. to do is to call `make erlang-mk`:
  16. [source,bash]
  17. ----
  18. $ make erlang-mk
  19. git clone https://github.com/ninenines/erlang.mk .erlang.mk.build
  20. Cloning into '.erlang.mk.build'...
  21. remote: Counting objects: 4035, done.
  22. remote: Compressing objects: 100% (12/12), done.
  23. remote: Total 4035 (delta 8), reused 4 (delta 4), pack-reused 4019
  24. Receiving objects: 100% (4035/4035), 1.10 MiB | 1000.00 KiB/s, done.
  25. Resolving deltas: 100% (2442/2442), done.
  26. Checking connectivity... done.
  27. if [ -f build.config ]; then cp build.config .erlang.mk.build; fi
  28. cd .erlang.mk.build && make
  29. make[1]: Entering directory '/home/essen/tmp/emkg/hello_joe/.erlang.mk.build'
  30. awk 'FNR==1 && NR!=1{print ""}1' core/core.mk index/*.mk core/index.mk core/deps.mk plugins/protobuffs.mk core/erlc.mk core/docs.mk core/test.mk plugins/asciidoc.mk plugins/bootstrap.mk plugins/c_src.mk plugins/ci.mk plugins/ct.mk plugins/dialyzer.mk plugins/edoc.mk plugins/elvis.mk plugins/erlydtl.mk plugins/escript.mk plugins/eunit.mk plugins/relx.mk plugins/shell.mk plugins/triq.mk plugins/xref.mk plugins/cover.mk \
  31. | sed 's/^ERLANG_MK_VERSION = .*/ERLANG_MK_VERSION = 1.2.0-642-gccd2b9f/' > erlang.mk
  32. make[1]: Leaving directory '/home/essen/tmp/emkg/hello_joe/.erlang.mk.build'
  33. cp .erlang.mk.build/erlang.mk ./erlang.mk
  34. rm -rf .erlang.mk.build
  35. ----
  36. All that's left to do is to commit the file!
  37. Yep, it's that easy.
  38. === Customizing the build
  39. Erlang.mk allows you to customize which plugins are to be included
  40. in the 'erlang.mk' file. You can do so by maintaining your own
  41. 'build.config' file in your repository. Erlang.mk will automatically
  42. use it the next time you run `make erlang-mk`.
  43. The 'build.config' file contains the list of all files that will
  44. be built into the resulting 'erlang.mk' file. You can start from
  45. the https://github.com/ninenines/erlang.mk/blob/master/build.config[most recent version]
  46. and customize to your needs.
  47. You can also name the file differently or put it in a separate folder
  48. by modifying the value for `ERLANG_MK_BUILD_CONFIG`. You can also
  49. tell Erlang.mk to use a different temporary directory by changing
  50. the `ERLANG_MK_BUILD_DIR` variable.