summaryrefslogtreecommitdiff
path: root/src/po/Submakefile
blob: 109bffa145c9499e23398eed91ca089d8f4d3684 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
../share/locale/%/LC_MESSAGES/linuxcnc.mo: po/%.po
	$(ECHO) Compiling localized message catalog $@
	@mkdir -p $(dir $@)
	$(Q)msgfmt -o $@ $<

../share/locale/%/LC_MESSAGES/gmoccapy.mo: po/gmoccapy/%.po
	$(ECHO) Compiling localized gmoccapy message catalog $@
	@mkdir -p $(dir $@)
	$(Q)msgfmt -o $@ $<

# the touch is because for po/zh_CN.po, msgfmt --tcl creates
# objects/zh_cn.po and on the next invocation make would try again to
# create zh_CN.po
objects/%.msg: po/%.po
	$(ECHO) Compiling localized message catalog $@
	$(Q)msgfmt --tcl -d objects -l $* $< && touch $@

MO_FILES := $(patsubst po/%.po, %/LC_MESSAGES/linuxcnc.mo, $(wildcard po/*.po))
MO_FILES += $(patsubst po/gmoccapy/%.po, %/LC_MESSAGES/gmoccapy.mo, $(wildcard po/gmoccapy/*.po))

$(DESTDIR)$(localedir)/%/LC_MESSAGES/linuxcnc.mo: ../share/locale/%/LC_MESSAGES/linuxcnc.mo
	$(DIR) $(DESTDIR)$(localedir)/$*/LC_MESSAGES
	$(FILE) $< $@

$(DESTDIR)$(localedir)/%/LC_MESSAGES/gmoccapy.mo: ../share/locale/%/LC_MESSAGES/gmoccapy.mo
	$(DIR) $(DESTDIR)$(localedir)/$*/LC_MESSAGES
	$(FILE) $< $@

TARGETS += $(patsubst po/%.po, \
	../share/locale/%/LC_MESSAGES/linuxcnc.mo, \
	$(wildcard po/*.po))

TARGETS += $(patsubst po/gmoccapy/%.po, \
	../share/locale/%/LC_MESSAGES/gmoccapy.mo, \
	$(wildcard po/gmoccapy/*.po))

TCLSRCS := \
	../tcl/bin/emccalib.tcl \
	../tcl/bin/emcdebug.tcl \
	../tcl/bin/emctesting.tcl \
	../tcl/bin/emctuning.tcl \
	../tcl/bin/genedit.tcl \
	../tcl/bin/halconfig.tcl \
	../tcl/bin/halshow.tcl \
	../tcl/bin/pickconfig.tcl \
	../tcl/bin/tkbackplot.tcl \
	../tcl/mini.tcl \
	../tcl/show_errors.tcl \
	../tcl/tklinuxcnc.tcl \
	../tcl/scripts/Set_Coordinates.tcl \
	../tcl/scripts/balloon.tcl \
	../tcl/scripts/emchelp.tcl \
	../tcl/ngcgui.tcl \
	../tcl/ngcgui_ttt.tcl \
	../tcl/ngcgui_app.tcl \
	../tcl/tooledit.tcl

po/linuxcnc.pot:
	$(ECHO) Localizing linuxcnc.pot
	(cd ..; $(XGETTEXT) -k_ -o src/$@ `src/po/fixpaths.py -j src $^`)
	touch $@
TARGETS += po/linuxcnc.pot

pofiles: po/linuxcnc.pot
	set -x; for i in po/*.po; do msgmerge -U $$i po/linuxcnc.pot; done

po/linuxcnc.pot: emc/task/emctaskmain.cc $(LIBRS274SRCS) emc/rs274ngc/rs274ngc_return.hh
po/linuxcnc.pot: hal/utils/meter.c \
    hal/utils/scope.c \
    hal/utils/scope_horiz.c \
    hal/utils/scope_vert.c \
    hal/utils/scope_trig.c \
    hal/utils/scope_disp.c \
    hal/utils/scope_files.c \
    hal/utils/miscgtk.c
po/linuxcnc.pot: emc/motion/control.c emc/motion/command.c emc/motion/motion.c emc/motion/homing.c

po/linuxcnc.pot: $(TCLSRCS)
po/linuxcnc.pot: $(PYI18NSRCS)

.PHONY: install-locale
install-locale: $(addprefix $(DESTDIR)$(localedir)/, $(MO_FILES))
install-kernel-indep: install-locale