telegabber/Makefile
2026-07-28 23:14:32 -04:00

32 lines
1.3 KiB
Makefile

.PHONY: all test
COMMIT := $(shell git rev-parse --short HEAD)
TD_COMMIT := "5bbfc1cf5dab94f82e02f3430ded7241d4653551"
VERSION := "v2.0.0-dev"
MAKEOPTS := "-j4"
# GOTAGS=signal_legacy builds the OMEMO cgo bindings against the pre-fork
# libsignal-protocol-c instead of libomemo-c (e.g. on Debian bullseye, which
# only packages the former) - Omemo0 (eu.siacs.conversations.axolotl) only,
# no Omemo1/Omemo2 (both need protocol v4, which vanilla libsignal-protocol-c
# doesn't have).
GOTAGS :=
all:
mkdir -p release
go build -ldflags "-X main.commit=${COMMIT}" -tags "${GOTAGS}" -o release/telegabber
test:
go test -tags "${GOTAGS}" -v ./config ./ ./telegram ./xmpp ./xmpp/gateway ./xmpp/extensions ./persistence ./telegram/formatter ./badger ./e2ee/...
lint:
$(GOPATH)/bin/golint ./...
build_indocker:
docker build --build-arg "TD_COMMIT=${TD_COMMIT}" --build-arg "VERSION=${VERSION}" --build-arg "MAKEOPTS=${MAKEOPTS}" --output=release --target binaries .
build_indocker_staging:
DOCKER_BUILDKIT=1 docker build --build-arg "TD_COMMIT=${TD_COMMIT}" --build-arg "MAKEOPTS=${MAKEOPTS}" --network host --output=release --target binaries -f staging.Dockerfile .
build_tdlib:
DOCKER_BUILDKIT=1 docker build --build-arg "TD_COMMIT=${TD_COMMIT}" --build-arg "MAKEOPTS=${MAKEOPTS}" --output=tdlib --target binaries -f tdlib.Dockerfile .