diff options
author | Loïc Hoguin <[email protected]> | 2015-12-14 18:35:48 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-12-14 18:37:56 +0100 |
commit | 4ea38e2319482b316a474d6fc82876e6fdcd7911 (patch) | |
tree | 56b8a02a842672d03e961e309dc6a4982f98d908 /doc/src/guide/ports.asciidoc | |
parent | 0f11e62b647c735bb13f957eeec9586be7e7b51a (diff) | |
download | erlang.mk-4ea38e2319482b316a474d6fc82876e6fdcd7911.tar.gz erlang.mk-4ea38e2319482b316a474d6fc82876e6fdcd7911.tar.bz2 erlang.mk-4ea38e2319482b316a474d6fc82876e6fdcd7911.zip |
Fix compilation of NIFs on Windows
Thanks to two users of the ninenines/esdl2 project,
a correct way to build NIFs on Windows has been found.
At the moment we require a specific compiler (MingW's
gcc). Maybe we can change this in the future and allow
Visual Studio and others.
Some small changes have been made to the documentation,
and the meaning of one configuration variable has changed
to not include the extension (which is decided automatically
by Erlang.mk; and configurable separately).
Enjoy!
Diffstat (limited to 'doc/src/guide/ports.asciidoc')
-rw-r--r-- | doc/src/guide/ports.asciidoc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/doc/src/guide/ports.asciidoc b/doc/src/guide/ports.asciidoc index b436c13..efe4ff7 100644 --- a/doc/src/guide/ports.asciidoc +++ b/doc/src/guide/ports.asciidoc @@ -64,9 +64,19 @@ before including Erlang.mk: [source,make] C_SRC_TYPE = executable -The generated file will be saved to '$(C_SRC_OUTPUT)'. It -defaults to '$(CURDIR)/priv/$(PROJECT).so', the filename -adequately fitting a Unix shared library. +The generated file name varies depending on the type of project +you have (shared library or executable) and on the platform you +build the project on. + +For shared libraries, the generated file name will be +'$(C_SRC_OUTPUT)$(C_SRC_SHARED_EXTENSION)', with the default +being '$(CURDIR)/priv/$(PROJECT)' followed by the extension: +`.dll` on Windows, `.so` everywhere else. + +For executables, the generated file name is +'$(C_SRC_OUTPUT)$(C_SRC_EXECUTABLE_EXTENSION)', with the same +default except for the extension: `.exe` on Windows, and otherwise +nothing. Erlang.mk sets appropriate compile and linker flags by default. These flags vary depending on the platform, and can of course |