From 4ea38e2319482b316a474d6fc82876e6fdcd7911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 14 Dec 2015 18:35:48 +0100 Subject: 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! --- doc/src/guide/ports.asciidoc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'doc/src/guide/ports.asciidoc') 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 -- cgit v1.2.3