diff --git a/Naggum.Compiler/Naggum.Compiler.fsproj b/Naggum.Compiler/Naggum.Compiler.fsproj index acbed1c..ffdbae4 100644 --- a/Naggum.Compiler/Naggum.Compiler.fsproj +++ b/Naggum.Compiler/Naggum.Compiler.fsproj @@ -42,17 +42,17 @@ - + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - + @@ -94,11 +94,11 @@ True - - \ No newline at end of file + diff --git a/Naggum.Test/Naggum.Test.fsproj b/Naggum.Test/Naggum.Test.fsproj index 2079617..abe97f7 100644 --- a/Naggum.Test/Naggum.Test.fsproj +++ b/Naggum.Test/Naggum.Test.fsproj @@ -36,17 +36,17 @@ - + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - + PreserveNewest @@ -94,11 +94,11 @@ True - - \ No newline at end of file + diff --git a/Naggum.sln b/Naggum.sln index 5f7a6d4..7466020 100644 --- a/Naggum.sln +++ b/Naggum.sln @@ -33,6 +33,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Naggum.Assembler", "Naggum.Assembler\Naggum.Assembler.fsproj", "{40B84F1E-1823-4255-80D4-1297613025C1}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{AFA24DE4-7328-448D-B0BE-1ABF4812B315}" + ProjectSection(SolutionItems) = preProject + docs\Build.md = docs\Build.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -63,4 +68,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {AFA24DE4-7328-448D-B0BE-1ABF4812B315} = {F85A1ACB-4A60-46A9-856D-92A3C9B97402} + EndGlobalSection EndGlobal diff --git a/Readme.md b/Readme.md index 335da4e..ed8d0b3 100644 --- a/Readme.md +++ b/Readme.md @@ -9,6 +9,11 @@ Naggum does not aim to be yet another Common Lisp or Scheme or Emacs Lisp or whatever implementation. Instead, we are trying to deliver a modern Lisp dialect that makes use of most of .Net's benefits. +## Build + +To build the project under various environments, see [build +instructions][build-instructions]. + ## License Naggum is licensed under the terms of MIT License. See License.md file for @@ -16,6 +21,7 @@ details. [andivionian-status-classifier]: https://github.com/ForNeVeR/andivionian-status-classifier [appveyor]: https://ci.appveyor.com/project/ForNeVeR/naggum/branch/develop +[build-instructions]: docs/Build.md [eric-naggum]: https://en.wikipedia.org/wiki/Erik_Naggum [travis]: https://travis-ci.org/codingteam/naggum diff --git a/docs/Build.md b/docs/Build.md new file mode 100644 index 0000000..3d21bdc --- /dev/null +++ b/docs/Build.md @@ -0,0 +1,72 @@ +Naggum Build Guide +================== + +Windows +------- + +To build Naggum on Windows, just use Visual Studio or MSBuild like that: + + $ cd naggum + $ nuget restore + $ msbuild /p:Configuration=Release Naggum.sln + +Linux +----- + +See general build instructions for Linux in the file `.travis.yml` inside the +Naggum source directory. + +You'll need [Mono][mono], [NuGet][nuget] and [F# Compiler][fsharp] installed. +Some of them may or may not be part of your Mono installation; just make sure +you've got them all. + +Below is an example of setting up these tools on [NixOS Linux][nixos]; feel free +to add instructions for any other distributions. + +### NixOS Linux + +First of all, install `mono` and `fsharp` packages to your environment: + + $ nix-env -i mono fsharp + +Please note that you need `fsharp` >= 4.0 to build Naggum, which is currently in +the unstable channel. So maybe you'll need to switch to the unstable channel or +build `fsharp` from [Nixpkgs][nixpkgs] source. + +According to the recommendations in +[`patch-fsharp-targets`][patch-fsharp-targets] build helper, you may want to set +up the environment variable `FSharpTargetsPath` either globally or locally: + + $ export FSharpTargetsPath=$(dirname $(which fsharpc))/../lib/mono/4.5/Microsoft.FSharp.Targets + +You'll need a NuGet executable. Unfortunately, there is no NixOS package for +NuGet, so you have to download it manually: + + $ nix-env -i wget # if not installed already + $ cd naggum + $ wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + +After that you can download the dependencies and build the project using +`xbuild`: + + $ mono nuget.exe restore Naggum.sln + $ xbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" Naggum.sln + +After that you should copy `FSharp.Core.dll` to the project output directory, +because currently Nix have problems with concept of Mono global assembly cache: + + $ FSHARP_CORE=$HOME/.nix-profile/lib/mono/Reference\ Assemblies/Microsoft/FSharp/.NETFramework/v4.0/4.4.0.0/FSharp.Core.dll + $ echo Naggum.*/bin/Release | xargs -n 1 cp -f "$FSHARP_CORE" + +After that, you can run Naggum.Compiler, for example: + + $ cd Naggum.Compiler/bin/Release/ + $ mono Naggum.Compiler.exe ../../../tests/test.naggum + $ mono test.exe + +[fsharp]: http://fsharp.org/ +[mono]: http://www.mono-project.com/ +[nixos]: http://nixos.org/ +[nixpkgs]: https://github.com/NixOS/nixpkgs +[nuget]: http://www.nuget.org/ +[patch-fsharp-targets]: https://github.com/NixOS/nixpkgs/blob/d4681bf62672083f92545e02e00b8cf040247e8d/pkgs/build-support/dotnetbuildhelpers/patch-fsharp-targets.sh