# Building

You may build plugins from scratch.

The build process doesn't differ much for GNU/Linux, FreeBSD or Windows. Build of JACK standalone versions for Windows is yet not supported.

For successful build for Linux/FreeBSD you need the following packages to be installed:

- gcc >= 4.7 OR clang >= 10.0.1
- gcc-c++ >= 4.7 OR clang-c++ >= 10.0.1
- libgcc_s1 >= 5.2
- libstdc++-devel >= 4.7
- jack-devel >= 1.9.5
- libsndfile-devel >= 1.0.25
- libcairo-devel >= 1.14
- php >= 5.5.14
- libiconv (for FreeBSD)
- libGL-devel >= 11.2.2

For Windows build, the following software needs to be installed:

- MinGW/MinGW-W64 >= 7.0
- Git >= 2.8 (optional)
- PHP >= 5.5.14
- GNU Make >= 4.2

To perform toolchain setup for Windows, you may perform the following steps:

- Download latest Git
- Download latest MinGW-W64 GCC
- Download latest PHP x64 Thread Safe ZIP package
- Install Git
- Unpack PHP ZIP to C:\php
- Unpack MinGW to C:\mingw64
- To make all installed software accessible from command line, add to the PATH environment variable following elements:
- C:\Program Files\Git\cmd
- C:\Program Files\Git\usr\bin
- C:\mingw64\bin
- C:\php

To build the project from archive with source code, the following sequence of commands should be performed:

      make clean
      make config
      make
      make install

To build the project from GIT repository, the additional 'make fetch' command should be issued to obtain all source code dependencies:

      make clean
      make config
      make fetch
      make
      make install

For Windows, the `make install` command creates 'INSTALL' subdirectory and places the plugin content into desired folders.

By default, all supported formats of plugins are built. The list of modules for build can be adjusted by specifying FEATURES variable at the configuration stage:

      make config FEATURES='lv2 vst2 doc'

Available modules are:

- clap - CLAP plugin binaries;
- doc - HTML documentation;
- jack - JACK plugin binaries;
- ladspa - LADSPA plugin binaries;
- lv2 - LV2 plugin binaries;
- vst2 - VST2/LinuxVST plugin binaries;
- vst3 - VST2 plugin binaries;
- xdg - the X11 desktop integration icons.

By default plugins use '/usr/local' path as a target directory for installation. To override this path, the PREFIX variable can be overridden:

      make config PREFIX=/usr

To build binaries for debugging, use the following commands:

      make config DEBUG=1

To build binaries for testing (developers only), use the following commands:

      make config TEST=1

To install plugins at the desired root directory, the DESTDIR variable can be specified:

      make install DESTDIR=<installation-root>

To build standalone source code package, the following commands can be issued:

      make config
      make distsrc

After that, a stanalone archive with source code will be created in the `.build` directory.

For more build options, issue:

      make help