File: Makefile

package info (click to toggle)
4digits 1.1.4-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 948 kB
  • sloc: python: 430; ansic: 235; makefile: 34
file content (44 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Makefile for 4digits

CC = gcc
CFLAGS = -Wall -std=c99 -pedantic -g
SHELL = /bin/sh
# For distribution packaging
#INSTALL_DIR = /usr/share/locale
INSTALL_DIR = locale

#all: 4digits-text compile-po
all: 4digits-text update-po compile-po install-po

trans: update-po compile-po install-po

4digits-text: 4digits-text.c
	$(CC) $(CFLAGS) 4digits-text.c -o 4digits-text

clean:
	rm -f 4digits-text
	rm -f po/*.mo po/*.po~

# Dirty hack: xgettext cannot guess that '4digits' is a python since it
# has no .py extension so we make a temporary symlink.
update-po:
	#Update 4digits.pot
	ln -sf 4digits 4digits.py
	xgettext 4digits.py 4digits-text.c 4digits.glade -o po/4digits.pot -k_ -kN_
	rm 4digits.py
	#Update translations
	for f in po/*.po; do \
		msgmerge -U $$f po/4digits.pot; \
	done

compile-po:
	for f in po/*.po; do \
		g=`echo $$f | sed -e 's/\.po/\.mo/'`; \
		msgfmt $$f -o $$g; \
	done

install-po:
	for g in po/*.mo; do \
		l=`echo $$g | sed -e 's#po/\(.*\)\.mo#\1#'`; \
		install -m644 -D $$g $(INSTALL_DIR)/$$l/LC_MESSAGES/4digits.mo; \
	done