Add Makefile for building stdlib
authorLuke Lau <luke_lau@icloud.com>
Sat, 9 Nov 2019 17:57:19 +0000 (17:57 +0000)
committerLuke Lau <luke_lau@icloud.com>
Sat, 9 Nov 2019 18:28:22 +0000 (18:28 +0000)
commite0a26bc0a8d6c8021c0a2da5bb66008a1c7a51de
tree72d63f8010b9158a7df962c175324c795878d02f
parent0b171dce6581f540f231ec877d35304c50f7a37b
Add Makefile for building stdlib

There are two ways we can go about including our standard library in our
language.
The first method is via statically linking it into our final executable,
by compiling our Haskell code and standard library object file with it.
The second method is to compile the standard library into a shared
library and dynamically load it at runtime.

Here we are going to do the latter, since it means we can still run our
code with runghc, at the cost of needing to locate the path to the
library inside Main.hs. (I'll include an example later on of how to
include it the static way)

macOS produces dylibs - Linux typically uses .so files. You may want to
rename the rule to align with whatever operating system you are
targeting.
.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]