#!/usr/bin/make -f
# SPDX-FileCopyrightText: 2016-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only

# This Makefile is copied to translation source packages generated by
# univention-ucs-translation-build-package. It defines the receipts to build
# binary translation targets(mo files). The include 'all_targets.mk' is
# generated by the same script and contains all actual targets.

.PHONY: build
build:

include all_targets.mk
.PHONY: install
install: $(ALL_TARGETS)

%.mo:
	install -d -m 755 "$(@D)"
	msgfmt --check --output-file="$@" "$<"

%.json:
	dh-umc-po2json "$<"  # creates .json file in the same directory as the .po file
	install -d -m 755 "$(@D)"
	mv "$(<:%.po=%.json)" "$@"
