Update ffi.rst to show example of correct including C code and example Makefile
That would save a lot of time since simple examples are hard to find.
commita0a9b7968ed28dd239ebb32140b9c7f7dccab9c4
authorJacek Podkanski <ruby.object@googlemail.com>
dateMon 24 Dec 2018, 18:11 (8 years ago)
parentecf297a
docs/reference/ffi.rst+18
@@ -115,6 +115,24 @@ For C, this is:
115115 FFI_C : FFI
116116 FFI_C = MkFFI C_Types String String
117117
118+Linking foreign code
119+====================
120+
121+This is the example of linking C code.
122+
123+.. code-block:: idris
124+ %include C "mylib.h"
125+ %link C "mylib.o"
126+
127+Example Makefile
128+
129+.. code-block:: shell
130+ DEFAULT: mylib.o main.idr
131+ idris main.idr -o executableFile
132+
133+ clean:
134+ rm -f executableFile mylib.o main.ibc
135+
118136Foreign calls
119137=============
120138