## Process this file with automake to produce Makefile.in
EXTRA_DIST = .
BUILD_TIME=`date +%H:%M:%S`
BUILD_DATE=`date +"%b %_d %Y"`
GOOS=`go env GOOS`
GOARCH=`go env GOARCH`
PKG=golang.zabbix.com/agent2/pkg/version
NEW_FROM_REV=""
GOLDFLAGS = -X '${PKG}.compileDate=${BUILD_DATE}'
GOLDFLAGS += -X ${PKG}.compileTime=${BUILD_TIME}
GOLDFLAGS += -X ${PKG}.compileOs=${GOOS}
GOLDFLAGS += -X ${PKG}.compileArch=${GOARCH}
AGENT_GOLDFLAGS = ${GOLDFLAGS}
AGENT_GOLDFLAGS += -X main.confDefault=${AGENT2_CONFIG_FILE}
AGENT_GOLDFLAGS += -X main.applicationName=zabbix_agent2
WEBSERVICE_GOLDFLAGS = ${GOLDFLAGS}
WEBSERVICE_GOLDFLAGS += -X main.applicationName=zabbix_web_service
if HAVE_PCRE
AGENT_GOTAGS = pcre
endif
if HAVE_PCRE2
AGENT_GOTAGS = pcre2
endif
dist_sysconf_DATA =
TARGETS =
INSTALL_TARGETS =
if AGENT2
TARGETS += bin/zabbix_agent2
INSTALL_TARGETS += install-bin/zabbix_agent2
dist_sysconf_DATA += conf/zabbix_agent2.conf
endif
if WEBSERVICE
TARGETS += bin/zabbix_web_service
INSTALL_TARGETS += install-bin/zabbix_web_service
dist_sysconf_DATA += conf/zabbix_web_service.conf
endif
all: build
bin/zabbix_agent2: FORCE
CGO_CFLAGS="${CGO_CFLAGS}" CGO_LDFLAGS="${CGO_LDFLAGS}" \
$(GO) build \
-tags="${AGENT_GOTAGS}" \
-ldflags="${AGENT_GOLDFLAGS}" \
-o bin \
golang.zabbix.com/agent2/cmd/zabbix_agent2
bin/zabbix_web_service: FORCE
$(GO) build \
-ldflags="${WEBSERVICE_GOLDFLAGS}" \
-o bin \
golang.zabbix.com/agent2/cmd/zabbix_web_service
build: ${TARGETS}
clean: clean-go-build clean-sbom
clean-go-build:
-$(GO) clean ./...
-rm -f bin/mock_server
-rm -f bin/zabbix_agent2
-rm -f bin/zabbix_web_service
clean-sbom:
-rm -f sbom-mod.json
-rm -f sbom-mod.xml
-rm -f sbom-za2.json
-rm -f sbom-za2.xml
-rm -f sbom-zws.json
-rm -f sbom-zws.xml
# Mode flags (-m) for $(INSTALL) have been intentionally omitted to avoid
# changing permission flags of existing directories and breaking their
# conformance to system policy.
#
# Directories are created for the case when we're installing into a staging
# environment where they may not exist at all.
install-bin/zabbix_agent2: bin/zabbix_agent2
$(INSTALL) -d "$(DESTDIR)$(sbindir)"
$(INSTALL_PROGRAM) bin/zabbix_agent2 "$(DESTDIR)$(sbindir)"
$(INSTALL) -d "$(DESTDIR)$(AGENT2_PLUGIN_CONFIG_DIR)"