aplat

Documents structurés pour Unix
git clone git://git.asteride.xyz/~ldp/aplat.git
Journaux | Fichiers | Références | LISEZ-MOI | LICENCE

commit 88bf0d5101e4b7a1fb300fcf9ce3bedcac50ccb6
parent 609c536839a03ea4b6300797f8b587d59ff94ac5
Auteur: Selve <selve@asteride.xyz>
Date:   Sun, 21 Jan 2024 12:05:15 -0500

prise en charge des traductions par la Makefile

Diffstat:
MMakefile | 46++++++++++++++++++++++++++++++++++++----------
1 file changed, 36 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,24 +1,50 @@ +PREFIX = /usr/local/bin +I18N_DOS = /usr/local/share/locale + +DOS_PO = po + +CC = cc COPT_SPCL = -O2 -DNDEBUG -COPT = -Wall -Wextra -Werror -Wpedantic --std=c89 ${COPT_SPCL} -CC = cc -PREFIX = /usr/local/bin -I18N_DOS = '"/usr/local/share/locale"' -CPPOPT = -I/usr/local/include -DI18N_DOMAINE='"aplat"' -DI18N_DOS=${I18N_DOS} +COPT = -Wall -Wextra -Werror -Wpedantic --std=c89 ${COPT_SPCL} +CPPOPT = -I/usr/local/include \ + -DI18N_DOMAINE=\"aplat\" \ + -DI18N_DOS=\"${I18N_DOS}\" + +FCH_PO != find ${DOS_PO} -name '*.po' +FCH_MO != find ${DOS_PO} -name '*.po' | sed 's/\.po$$/\.mo/' -.SUFFIXES: .c .o +.SUFFIXES: .c .o .po .mo .c.o: ${CC} ${COPT} ${CPPOPT} -c "$<" -all: aplat +.po.mo: + msgfmt -o "$@" "$<" + +all: aplat traductions aplat: aplat.o tampon.o ${CC} ${COPT} -L/usr/local/lib -lintl -o "$@" aplat.o tampon.o -install: aplat - install -m 755 aplat ${PREFIX}/aplat +traductions: ${FCH_MO} + +install: aplat traductions + mkdir -p "${PREFIX}" + install -m 755 aplat "${PREFIX}"/aplat + for F in ${FCH_MO} ; \ + do \ + LANGUE="$$(echo "$$F" | sed 's|.*/\(.*\)\..*|\1|')" ; \ + mkdir -p "${I18N_DOS}/$$LANGUE/LC_MESSAGES" ; \ + install -m 755 $$F \ + "${I18N_DOS}/$$LANGUE/LC_MESSAGES/aplat.mo" ; \ + done uninstall: rm -f ${PREFIX}/aplat + for F in ${FCH_MO} ; \ + do \ + LANGUE="$$(echo "$$F" | sed 's|.*/\(.*\)\..*|\1|')" ; \ + rm -f "${I18N_DOS}/$$LANGUE/LC_MESSAGES/aplat.mo" ; \ + done clean: - rm -f aplat *.o *.core + rm -f aplat *.o *.core po/*.mo