shake-language-c

shake-language-c is a cross-platform build system based on the Shake Haskell library. The focus is on cross-compilation of C, C++ and Objective C source code to various target platforms. Currently supported target platforms are iOS, Android NDK, Google Portable Native Client, MacOS X, Linux and Windows (MinGW). Supported host platforms are MacOS X, Linux and Windows.

Documentation

Please see the package documentation. Feel free to open an issue or send a pull request if there’s anything missing that you want to see covered.

Examples

Here’s an iOS example that compiles all .cpp files in the src directory. The resulting static library libexample.a can then be used e.g. from an XCode project.

A more complex build script is used by the Methcla sound engine library. It defines Shake rules for building the library on various platforms and also exports functions for transparently including the library into other build systems. The build script makes extensive use of Shake configuration files.

Changes

Changelog for shake-language-c

v0.12.0

Support GHC 8.4.1

v0.11.0

Support shake 0.16

v0.10.1

Add support for Linux ARMv7

v0.10.0

Add mkConfig function that caches dependencies

v0.9.1

Fix host architecture detection on Windows 10

v0.9.0

Add support for the Android arm64-v8a target architecture and drop support for specifying the toolchain version; this API breaking change requires a minimum Android NDK revision 11c

v0.8.6

Fix Windows host target

Get host architecture from environment on Windows

v0.8.3

Allow to set linker command via LD environment variable

v0.8.2

Fix compiler and linker commands for Clang toolchain on Linux

v0.8.1

Use -I compiler flag for the userIncludes of BuildFlags and -isystem for systemIncludes; semantics should be as before for gcc and clang but -isystem suppresses warnings in system headers

v0.8.0

Refactor NMF file creation in NaCl module

v0.7.1

Fix compilation error with GHC 7.10 in test suite (#25)

v0.7.0

Add arm64 ARM version

Add support for arm64 to OSX toolchains

Fix compilation error with GHC 7.10 (#25)

v0.6.4

Fix Android toolchain definition for x86 architecture

v0.6.3

Fix bug in Development.Shake.Language.C.Target.OSX: getPlatformVersionsWithRoot works correctly now with SDK directories without version number, as introduced by Xcode 6