.. _build_makefile: Makefile ======== OSSEC is using (starting with 2.9) a single Makefile to build the binaries for each installation type. The ``Makefile`` uses features of `GNU make `_, and it is a requirement of the build process. The make system attempts to perform all necessary tasks in a single run. The type of installation must be specified when executed because there is no state stored between executions. Settings -------- All changes to the makefile that take external input should be reported via the settings build step. This allows troubleshooting and review of the environment, and the hope is that some new features will become discoverable for other developers. .. code-block:: console % make DATABASE=mysql TARGET=server USE_ZEROMQ=1 USE_GEOIP=1 settings General settings: TARGET: server V: DEBUG: DEBUGAD PREFIX: /var/ossec MAXAGENTS: 2048 DATABASE: mysql User settings: OSSEC_GROUP: ossec OSSEC_USER: ossec OSSEC_USER_MAIL: ossecm OSSEC_USER_REM: ossecr Lua settings: LUA_PLAT: macosx USE settings: USE_ZEROMQ: 1 USE_GEOIP: 1 USE_PRELUDE: 0 Mysql settings: includes: -I/usr/include/mysql/ libs: -L/usr/lib/mysql -lmysqlclient Pgsql settings: includes: libs: Defines: -DMAX_AGENTS=2048 -DOSSECHIDS -DDarwin -DHIGHFIRST -DZEROMQ_OUTPUT -DGEOIP -DUMYSQL Compiler: CFLAGS -DMAX_AGENTS=2048 -DOSSECHIDS -DDarwin -DHIGHFIRST -DZEROMQ_OUTPUT -DGEOIP -DUMYSQL -Wall -Wextra -O2 -I./ -I./headers/ LDFLAGS -lzmq -lczmq -lGeoIP -L/usr/lib/mysql -lmysqlclient CC cc MAKE /Applications/Xcode.app/Contents/Developer/usr/bin/make Options / Variables -------------------- .. envvar:: TARGET Defines the type of installation to build. **Allowed:** server/agent/hybrid/local .. envvar:: V ``V`` can toggle verbose building, and will instruct ``make`` to display the full output without color. **Applies to Target:** all **Default:** 0 **Allowed:** 0/1 .. envvar:: PREFIX ``PREFIX`` is the absolute path OSSEC will be installed to. .. warning:: Please note that paths with SPACES and tabs in them are not supported and may cause compilation or runtime issues. **Applies to Target:** all **Default:** /var/ossec **Allowed:** All valid paths .. envvar:: ZLIB_SYSTEM .. versionadded:: 3.0 ``ZLIB_SYSTEM`` can enable OSSEC to use a pre-installed zlib instead of the bundled version. **Applies to Target:** all **Default:** no **Allowed:** yes/no .. envvar:: LUA_ENABLE .. versionadded:: 3.0 ``LUA_ENABLE`` can enable or disable the bundled lua support. **Applies to Target:** all **Default:** yes **Allowed:** yes/no .. envvar:: MAXAGENTS OSSEC is compiled with a maximum number of agents on the server/hybrid TARGETS. ``MAXAGENTS`` allows users to select values expected for their environment. **Applies to Target:** server/hybrid **Default:** 2048 **Allowed:** [2 - 65000] .. envvar:: DEBUG ``DEBUG`` enables debugging symbols in all compiled programs. **Applies to Target:** all **Default:** 0 **Allowed:** 0/1 .. envvar:: DEBUGAD ``DEBUGAD`` enables extra debugging logging in ossec-analysisd. **Applies to Target:** server/hybrid **Default:** 0 **Allowed:** 0/1 .. envvar:: OSSEC_USER **Default:** ossec .. envvar:: OSSEC_GROUP **Default:** ossec .. envvar:: OSSEC_USER_MAIL **Default:** ossecm .. envvar:: OSSEC_USER_REM **Default:** ossecr .. envvar:: LUA_PLAT ``LUA_PLAT`` determines the platform that LUA will be compiled for. This is autogenerated for each install. **Applies to Target:** all .. envvar:: USE_GEOIP ``USE_GEOIP`` enables support for `MAX Mind GeoIP `_ looks on output. **Applies to Target:** server/hybrid/local **Default:** 0 **Allowed:** 0/1 .. envvar:: USE_PRELUDE ``USE_PRELUDE`` enables support for `Prelude-IDS `_ alert output. **Applies to Target:** server/hybrid/local **Default:** 0 **Allowed:** 0/1 .. envvar:: USE_ZEROMQ ``USE_ZEROMQ`` enables support for zeromq output. **Applies to Target:** server/hybrid/local **Default:** 0 **Allowed:** 0/1 .. envvar:: USE_SQLITE ``USE_SQLITE`` enables support for sqlite3 databases. **Spplies to Target:** server/hybrid/local **Default:** 0 **Allowed:** 0/1 .. envvar:: DATABASE The ``DATABASE`` variable selects the database enviromnet to enable. **Applies to Target:** server/hybrid/local **Allowed:** mysql/pgsql