Makefile (2264B)
1 VERSION = 2.0-ε/1 (2024/06/07) 2 3 PREFIX = /usr/local 4 BIN_DOS = ${PREFIX}/bin 5 MAN_DOS = ${PREFIX}/man 6 I18N_DOS = ${PREFIX}/share/locale 7 LIB_DOS = /usr/local/lib 8 INC_DOS = /usr/local/include 9 LIBS = -lintl 10 11 DOS_PO = po 12 DOS_MAN = man 13 14 CC = cc 15 #COPTS_SPCL = -O2 -DNDEBUG 16 COPTS = -Wall -Wextra -Werror -Wpedantic -Wno-implicit-fallthrough \ 17 -std=c89 ${COPTS_SPCL} 18 CPPOPTS = -I${INC_DOS} -DI18N_DOMAINE="\"aplat\"" \ 19 -DI18N_DOS="\"${I18N_DOS}\"" \ 20 -DVERSION="\"${VERSION}\"" 21 LDOPTS = -L${LIB_DOS} 22 23 FCH_PO != find ${DOS_PO} -name '*.po' 24 FCH_MO != find ${DOS_PO} -name '*.po' | sed 's/\.po$$/\.mo/' 25 26 LANG_MAN != ls "${DOS_MAN}" 27 28 .SUFFIXES: .c .o .po .mo 29 .c.o: 30 ${CC} ${COPTS} ${CPPOPTS} -c "$<" 31 32 .po.mo: 33 msgfmt -o "$@" "$<" 34 35 all: aplat assembler assurer traductions 36 37 aplat: aplat.o tampon.o general.o 38 ${CC} ${COPTS} ${LDOPTS} -o "$@" aplat.o tampon.o general.o ${LIBS} 39 40 assembler: assembler.o 41 ${CC} ${COPTS} ${LDOPTS} -o "$@" assembler.o ${LIBS} 42 43 assurer: assurer.o general.o 44 ${CC} ${COPTS} ${LDOPTS} -o "$@" assurer.o general.o ${LIBS} 45 46 traductions: ${FCH_MO} 47 48 maj_trad: 49 xgettext --from-code=UTF-8 -k_ -o - *.c | \ 50 msgmerge -qo "${DOS_PO}/modele.pot" "${DOS_PO}/modele.pot" - 51 for F in ${FCH_PO} ; \ 52 do \ 53 msgmerge -qo "$$F" "$$F" "${DOS_PO}/modele.pot" ; \ 54 done 55 56 inst_aplat: 57 mkdir -p "${BIN_DOS}" 58 install -m 755 aplat "${BIN_DOS}"/aplat 59 60 inst_assembler: 61 mkdir -p "${BIN_DOS}" 62 install -m 755 assembler "${BIN_DOS}"/assembler 63 64 inst_trad: 65 for F in ${FCH_MO} ; \ 66 do \ 67 LANGUE="$$(echo "$$F" | sed 's|.*/\(.*\)\..*|\1|')" ; \ 68 mkdir -p "${I18N_DOS}/$$LANGUE/LC_MESSAGES" ; \ 69 cp $$F \ 70 "${I18N_DOS}/$$LANGUE/LC_MESSAGES/aplat.mo" ; \ 71 done 72 73 inst_man: 74 for L in ${LANG_MAN} ; \ 75 do \ 76 mkdir -p ${MAN_DOS}/$$L/man1 ; \ 77 cp "${DOS_MAN}/$$L/aplat.1" "${MAN_DOS}/$$L/man1" ; \ 78 mkdir -p ${MAN_DOS}/$$L/man5 ; \ 79 cp "${DOS_MAN}/$$L/aplat.5" "${MAN_DOS}/$$L/man5" ; \ 80 cp "${DOS_MAN}/$$L/plat.5" "${MAN_DOS}/$$L/man5" ; \ 81 done 82 83 install: all inst_aplat inst_assembler inst_trad inst_man 84 85 uninstall: 86 rm -f ${BIN_DOS}/aplat 87 find "${I18N_DOS}" -type f -name 'aplat.mo' | xargs rm -f 88 find "${MAN_DOS}" -type f -name 'a?plat.[123456789]' | xargs rm -f 89 90 clean: 91 rm -f aplat *.o *.core po/*.mo