| 1 | ### Get the sources |
| 2 | ```bash |
| 3 | # using git is preferred |
| 4 | git clone https://github.com/sass/libsass.git |
| 5 | # only needed for sassc and/or testsuite |
| 6 | git clone https://github.com/sass/sassc.git libsass/sassc |
| 7 | git clone https://github.com/sass/sass-spec.git libsass/sass-spec |
| 8 | ``` |
| 9 | |
| 10 | ### Decide for static or shared library |
| 11 | |
| 12 | `libsass` can be built and linked as a `static` or as a `shared` library. The default is `static`. To change it you can set the `BUILD` environment variable: |
| 13 | |
| 14 | ```bash |
| 15 | export BUILD="shared" |
| 16 | ``` |
| 17 | |
| 18 | Alternatively you can also define it directly when calling make: |
| 19 | |
| 20 | ```bash |
| 21 | BUILD="shared" make ... |
| 22 | ``` |
| 23 | |
| 24 | ### Compile the library |
| 25 | ```bash |
| 26 | make -C libsass -j5 |
| 27 | ``` |
| 28 | |
| 29 | ### Results can be found in |
| 30 | ```bash |
| 31 | $ ls libsass/lib |
| 32 | libsass.a libsass.so |
| 33 | ``` |
| 34 | |
| 35 | ### Install onto the system |
| 36 | |
| 37 | We recommend to use [autotools to install](build-with-autotools.md) libsass onto the |
| 38 | system, since that brings all the benefits of using libtools as the main install method. |
| 39 | If you still want to install libsass via the makefile, you need to make sure that gnu |
| 40 | `install` utility (or compatible) is installed on your system. |
| 41 | ```bash |
| 42 | yum install coreutils # RedHat Linux |
| 43 | emerge -a coreutils # Gentoo Linux |
| 44 | pkgin install coreutils # SmartOS |
| 45 | ``` |
| 46 | |
| 47 | You can set the install location by setting `PREFIX` |
| 48 | ```bash |
| 49 | PREFIX="/opt/local" make install |
| 50 | ``` |
| 51 | |
| 52 | |
| 53 | ### Compling sassc |
| 54 | |
| 55 | ```bash |
| 56 | # Let build know library location |
| 57 | export SASS_LIBSASS_PATH="`pwd`/libsass" |
| 58 | # Invokes the sassc makefile |
| 59 | make -C libsass -j5 sassc |
| 60 | ``` |
| 61 | |
| 62 | ### Run the spec test-suite |
| 63 | |
| 64 | ```bash |
| 65 | # needs ruby available |
| 66 | # also gem install minitest |
| 67 | make -C libsass -j5 test_build |
| 68 | ``` |