From ded13c27c6e9b88eb088677e031c5d86dff289ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sun, 17 Sep 2017 18:36:53 +0200 Subject: Update user guide --- guide/index.html | 2 +- guide/ports.html | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/guide/index.html b/guide/index.html index f4f719c..b6ade74 100644 --- a/guide/index.html +++ b/guide/index.html @@ -33,7 +33,7 @@ div.navfooter{margin-bottom:1em}
-

Erlang.mk User Guide

Loïc Hoguin


Table of Contents

1. Installation
1.1. On Unix
1.2. On Windows
2. Getting started
2.1. Creating a folder for your project
2.2. Downloading Erlang.mk
2.3. Getting started with OTP applications
2.4. Getting started with OTP libraries
2.5. Getting started with OTP releases
2.6. Getting started from scratch
2.7. Using spaces instead of tabs
2.8. Using templates
2.9. Hiding Erlang.mk from git
2.10. Getting help
3. Overview
3.1. Building your project
3.2. Exploring the package index
3.3. Generating documentation
3.4. Running tests
3.5. Need more?
4. Updating Erlang.mk
4.1. Initial bootstrap
4.2. Updating
4.3. Customizing the build
5. Limitations
5.1. Erlang must be available
5.2. Spaces in path
5.3. Dependency tracking and modification times
I. Code
6. Building
6.1. How to build
6.2. What to build
6.3. Application resource file
6.4. Automatic application resource file values
6.5. File formats
6.6. Compilation options
6.7. Cold and hot builds
6.8. Dependency tracking
6.9. Generating Erlang source
6.10. Cleaning
7. Packages and dependencies
7.1. Searching packages
7.2. Adding dependencies to your project
7.3. How deps are fetched and built
7.4. Fetching and listing dependencies only
7.5. Ignoring unwanted dependencies
7.6. Dependencies directory
7.7. Many applications in one repository
7.8. Repositories with no application at the root level
7.9. Autopatch
7.10. Skipping deps
8. NIFs and port drivers
8.1. C source code location and Erlang environment
8.2. Using a custom Makefile
8.3. Using Erlang.mk directly
9. Releases
9.1. Setup
9.2. Configuration
9.3. Generating the release
9.4. Running the release
9.5. Upgrading a release
9.6. Getting Relx semver value
10. Self-extracting releases
10.1. Generating the self-extracting archive
10.2. Running the release
11. Escripts
11.1. Requirements
11.2. Generating an escript
11.3. Configuration
11.4. Extra files
11.5. Optimizing for size
12. OTP version management
12.1. Erlang versions
12.2. OTP version pinning
12.3. Continuous integration
12.4. Configuring Kerl
13. Compatibility with other build tools
13.1. Rebar projects as Erlang.mk dependencies
13.2. Erlang.mk projects as Rebar dependencies
II. Documentation
14. AsciiDoc documentation
14.1. Requirements
14.2. Writing AsciiDoc documentation
14.3. Configuration
14.4. Usage
15. EDoc comments
15.1. Writing EDoc comments
15.2. Configuration
15.3. Usage
III. Tests
16. Erlang shell
16.1. Configuration
16.2. Usage
17. EUnit
17.1. Writing tests
17.2. Configuration
17.3. Usage
18. Common Test
18.1. Writing tests
18.2. Configuration
18.3. Usage
19. Code coverage
20. Continuous integration
20.1. Configuring Erlang/OTP versions to test
20.2. Running tests across all configured versions
20.3. Extending the CI targets
21. Dialyzer
21.1. How it works
21.2. Configuration
21.3. Usage
22. Xref
IV. Third-party plugins
23. External plugins
23.1. Loading all plugins from a dependency
23.2. Loading one plugin from a dependency
23.3. Writing external plugins
23.4. Early-stage plugins
23.5. Loading plugins local to the application
24. List of plugins
24.1. efene.mk
24.2. elixir.mk
24.3. elvis.mk
24.4. geas
24.5. hexer.mk
24.6. hexpm.mk
24.7. jorel
24.8. lfe.mk
24.9. mix.mk
24.10. reload.mk
24.11. rust.mk
V. About Erlang.mk
25. Why Erlang.mk
25.1. Erlang.mk is fast
25.2. Erlang.mk gives you the full power of Unix
25.3. Erlang.mk is a text file
25.4. Erlang.mk can manage Erlang itself
25.5. Erlang.mk can do more than Erlang
25.6. Erlang.mk integrates nicely in Make and Automake projects
26. Short history
26.1. Before Erlang.mk
26.2. Lifetime of the project
27. Contributing
27.1. Priorities
27.2. Bugs
27.3. Code
27.4. Packages
27.5. Documentation
27.6. Feature requests
+

Erlang.mk User Guide

Loïc Hoguin


Table of Contents

1. Installation
1.1. On Unix
1.2. On Windows
2. Getting started
2.1. Creating a folder for your project
2.2. Downloading Erlang.mk
2.3. Getting started with OTP applications
2.4. Getting started with OTP libraries
2.5. Getting started with OTP releases
2.6. Getting started from scratch
2.7. Using spaces instead of tabs
2.8. Using templates
2.9. Hiding Erlang.mk from git
2.10. Getting help
3. Overview
3.1. Building your project
3.2. Exploring the package index
3.3. Generating documentation
3.4. Running tests
3.5. Need more?
4. Updating Erlang.mk
4.1. Initial bootstrap
4.2. Updating
4.3. Customizing the build
5. Limitations
5.1. Erlang must be available
5.2. Spaces in path
5.3. Dependency tracking and modification times
I. Code
6. Building
6.1. How to build
6.2. What to build
6.3. Application resource file
6.4. Automatic application resource file values
6.5. File formats
6.6. Compilation options
6.7. Cold and hot builds
6.8. Dependency tracking
6.9. Generating Erlang source
6.10. Cleaning
7. Packages and dependencies
7.1. Searching packages
7.2. Adding dependencies to your project
7.3. How deps are fetched and built
7.4. Fetching and listing dependencies only
7.5. Ignoring unwanted dependencies
7.6. Dependencies directory
7.7. Many applications in one repository
7.8. Repositories with no application at the root level
7.9. Autopatch
7.10. Skipping deps
8. NIFs and port drivers
8.1. C source code location and Erlang environment
8.2. Using a custom Makefile
8.3. Using Erlang.mk directly
8.4. Propagating compile and linker flags to sub-Makefiles
9. Releases
9.1. Setup
9.2. Configuration
9.3. Generating the release
9.4. Running the release
9.5. Upgrading a release
9.6. Getting Relx semver value
10. Self-extracting releases
10.1. Generating the self-extracting archive
10.2. Running the release
11. Escripts
11.1. Requirements
11.2. Generating an escript
11.3. Configuration
11.4. Extra files
11.5. Optimizing for size
12. OTP version management
12.1. Erlang versions
12.2. OTP version pinning
12.3. Continuous integration
12.4. Configuring Kerl
13. Compatibility with other build tools
13.1. Rebar projects as Erlang.mk dependencies
13.2. Erlang.mk projects as Rebar dependencies
II. Documentation
14. AsciiDoc documentation
14.1. Requirements
14.2. Writing AsciiDoc documentation
14.3. Configuration
14.4. Usage
15. EDoc comments
15.1. Writing EDoc comments
15.2. Configuration
15.3. Usage
III. Tests
16. Erlang shell
16.1. Configuration
16.2. Usage
17. EUnit
17.1. Writing tests
17.2. Configuration
17.3. Usage
18. Common Test
18.1. Writing tests
18.2. Configuration
18.3. Usage
19. Code coverage
20. Continuous integration
20.1. Configuring Erlang/OTP versions to test
20.2. Running tests across all configured versions
20.3. Extending the CI targets
21. Dialyzer
21.1. How it works
21.2. Configuration
21.3. Usage
22. Xref
IV. Third-party plugins
23. External plugins
23.1. Loading all plugins from a dependency
23.2. Loading one plugin from a dependency
23.3. Writing external plugins
23.4. Early-stage plugins
23.5. Loading plugins local to the application
24. List of plugins
24.1. efene.mk
24.2. elixir.mk
24.3. elvis.mk
24.4. geas
24.5. hexer.mk
24.6. hexpm.mk
24.7. jorel
24.8. lfe.mk
24.9. mix.mk
24.10. reload.mk
24.11. rust.mk
V. About Erlang.mk
25. Why Erlang.mk
25.1. Erlang.mk is fast
25.2. Erlang.mk gives you the full power of Unix
25.3. Erlang.mk is a text file
25.4. Erlang.mk can manage Erlang itself
25.5. Erlang.mk can do more than Erlang
25.6. Erlang.mk integrates nicely in Make and Automake projects
26. Short history
26.1. Before Erlang.mk
26.2. Lifetime of the project
27. Contributing
27.1. Priorities
27.2. Bugs
27.3. Code
27.4. Packages
27.5. Documentation
27.6. Feature requests
diff --git a/guide/ports.html b/guide/ports.html index 718b833..a741cba 100644 --- a/guide/ports.html +++ b/guide/ports.html @@ -95,7 +95,21 @@ be overriden.

The source files are automatically gathered from the contents of $(C_SRC_DIR). Erlang.mk looks for .c, .C, .cc and .cpp source files. You can define the variable SOURCES to manually -list the files to compile.

+list the files to compile.

8.4. Propagating compile and linker flags to sub-Makefiles

In some cases it might be necessary to propagate the flags +you just defined to the sub-Makefiles of your local project. +You generally can’t just export those as this could impact +the building of dependencies.

Makefiles allow you to export variables for specific targets. +When doing this, the variables will be exported only when +this target runs, and not for other targets. It is therefore +possible to export them when building the C code without +impacting other build steps.

By adding this to your Makefile all five variables will be +made available to sub-Makefiles when building C code:

app-c_src: export CC +=
+app-c_src: export CFLAGS +=
+app-c_src: export CPPFLAGS +=
+app-c_src: export LDFLAGS +=
+app-c_src: export LDLIBS +=

Appending an empty string to the existing value is necessary +because Makefiles expect an assignment for target-specific +exports. Alternatively you can set a new value:

app-c_src: export CFLAGS = -O3
-- cgit v1.2.3