Makefile options

This section contains instructions to customize the installation of Wazuh by compiling the source code before executing the installation script. It also details the available Makefile configuration options, including descriptions, default values, and allowed values for each setting.

Compiling the source code

When following the official documentation to install the Wazuh server or the Wazuh agent from sources, the user runs the install.sh script. This script automatically compiles the source code before installing it, but some customizations can be made prior to the script execution.

To compile the code with make, the working directory must be where the Makefile resides. In this case, the /src directory of the installation folder:

# cd wazuh/src
# make deps
# make <OPTIONS>

Note

By default, the make deps command will download the necessary pre-compiled dependencies for Wazuh manager nodes. To download the dependencies for the Wazuh agent type nodes, it is necessary to indicate TARGET=agent or TARGET=winagent in case it is a Windows agent. To download the external dependencies without pre-compiled files, the make deps command needs to be executed with the EXTERNAL_SRC_ONLY=yes flag. The external dependencies will be built as part of the Wazuh compilation process.

After compiling the source code, now you can execute the installation script:

# cd ../
# ./install.sh

Warning

Some dependencies must be downloaded before compiling. If make deps is not executed before that, an error message will appear asking the user to do it.

Makefile reference

We show available targets and flags for using the Makefile command.

Available targets

deps

Downloads external dependencies, required for compiling the code. If TARGET is not specified, it will download the dependencies of the Wazuh manager nodes (TARGET=server).

To download the dependencies of the Wazuh agents, it is necessary to use TARGET=agent or TARGET=winagent in case it is a Windows agent. This requires internet connectivity.

external

Compiles the external dependencies. This is done automatically when using build.

build

Compiles the source code. This requires external dependencies and a TARGET flag.

utils

Compiles the complementary tools used by Wazuh binaries.

test-rules

Runs test suite for rules and decoders.

clean

Removes all contents, including compiled files, including external dependencies, tests, and configuration.

clean-deps

Removes all external dependencies, including downloaded files.

clean-external

Removes compiled external dependencies, but won't remove downloaded files.

clean-internals

Removes all compiled internal dependencies.

clean-framework

Removes all compiled files used to build the Wazuh framework.

clean-windows

Removes all compiled files used to build the Windows agent.

clean-config

Removes all compiled configuration files.

clean-test

Removes all compiled files used for testing.

There are other targets used to get information about the Makefile, but they won't build, download or compile anything:

help

Shows information about the Makefile.

settings

Shows default values of compilation flags.

Available flags

EXTERNAL_SRC_ONLY

Along with the make deps command, this will download external library sources without pre-compiled files.

Default value

N/A

Allowed values

1, yes, YES, y, Y

TARGET

Defines the type of installation to build. The most common are server to compile a manager, and agent/winagent to compile linux and windows agents respectively.

Default value

N/A

Allowed values

server, local, hybrid, agent, winagent

V

Displays full compiler messages.

Default value

N/A

Allowed values

1, yes, YES, y, Y

DEBUG

Builds with symbols and without optimization.

Default value

N/A

Allowed values

1, yes, YES, y, Y

DEBUGAD

Enables extra debugging logging in wazuh-analysisd.

Default value

N/A

Allowed values

1, yes, YES, y, Y

INSTALLDIR

Wazuh installation path. Mandatory when compiling the python interpreter from sources using PYTHON_SOURCE.

Default value

N/A

Allowed values

Any valid absolute path.

ONEWAY

Disables the Wazuh manager ACK towards the agent. It allows connecting agents without a backward connection from the manager.

Default value

N/A

Allowed values

1, yes, YES, y, Y

CLEANFULL

Makes the alert mailing subject clear in the format: <location> - <level> - <description>

Default value

N/A

Allowed values

1, yes, YES, y, Y

RESOURCES_URL

Sets the Wazuh resources URL.

Default value

https://packages.wazuh.com/deps/$(VERSION)

Allowed values

Any valid URL string.

USE_ZEROMQ

Builds with ZeroMQ support.

Default value

N/A

Allowed values

1, yes, YES, y, Y

USE_PRELUDE

Builds with Prelude support.

Default value

N/A

Allowed values

1, yes, YES, y, Y

USE_INOTIFY

Builds with Inotify support.

Default value

N/A

Allowed values

1, yes, YES, y, Y

USE_MSGPACK_OPT

Builds with Msgpack full optimization.

Default value

N/A

Allowed values

1, yes, YES, y, Y

BIG_ENDIAN

Builds with big endian support.

Default value

N/A

Allowed values

1, yes, YES, y, Y

USE_SELINUX

Builds with SELinux policies.

Default value

N/A

Allowed values

1, yes, YES, y, Y

USE_AUDIT

Builds with audit service support.

Default value

N/A

Allowed values

1, yes, YES, y, Y

DISABLE_JEMALLOC

Disables the integration of the jemalloc library.

Default value

N/A

Allowed values

1, yes, YES, y, Y

PYTHON_SOURCE

Used along with the deps target. Downloads the sources needed to build the python interpreter.

Default value

N/A

Allowed values

1, yes, YES, y, Y

USE_GEOIP

Builds with GeoIP support.

Default value

N/A

Allowed values

1, yes, YES, y, Y

OPTIMIZE_CPYTHON

Enable this flag to optimize the python interpreter build, which is performed when using PYTHON_SOURCE.

Default value

N/A

Allowed values

1, yes, YES, y, Y

DATABASE

Builds with database support. Allows support for MySQL or PostgreSQL.

Default value

N/A

Allowed values

mysql, pgsql

WAZUH_GROUP

Defines the WAZUH group.

Default value

wazuh

Allowed values

Any string.

WAZUH_USER

Defines the WAZUH user.

Default value

wazuh

Allowed values

Any string.

DISABLE_SYSC

Disables the compilation of the Syscollector module.

Default value

N/A

Allowed values

1, yes, YES, y, Y

IMAGE_TRUST_CHECKS

Configures the action to take when a library is not trusted in Windows. Actions available: Disabled (0), Only generate warning (1), and Shutdown the agent (2).

Default value

1

Allowed values

0, 1, 2

CA_NAME

Defines the name of the CA certificate.

Default value

DigiCert Assured ID Root CA

Allowed values

Any string.