File: Makefile.am

package info (click to toggle)
filezilla 3.39.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 32,852 kB
  • sloc: cpp: 94,492; ansic: 47,005; sh: 4,402; makefile: 1,886; xml: 366
file content (128 lines) | stat: -rw-r--r-- 4,348 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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
CLEANFILES = *.po.new *.mo resources.h filezilla.pot filezilla.pot.new filezilla.pot~

dist_noinst_DATA = filezilla.pot @FILEZILLA_LINGUAS_PO@

install-data-local: install-filezilla-catalogs

install-filezilla-catalogs: allmo
	for i in @FILEZILLA_LINGUAS@ ; do \
	  $(mkinstalldirs) $(DESTDIR)$(localedir)/$$i/LC_MESSAGES ; \
	  $(INSTALL_DATA) $$i.mo $(DESTDIR)$(localedir)/$$i/LC_MESSAGES/filezilla.mo ; \
	done

uninstall-local:
	for i in @FILEZILLA_LINGUAS@ ; do \
	  rm $(DESTDIR)$(localedir)/$$i/LC_MESSAGES/filezilla.mo ; \
	done


# Unused code
#WXWIN_LINGUAS  =    de

#install-wxstd-catalogs:
#	for i in $(WXWIN_LINGUAS) ; do \
#	  $(mkinstalldirs) $(DESTDIR)$(localedir)/$$i ; \
#	  $(INSTALL_DATA) wxwin/$$i.mo $(DESTDIR)$(localedir)/$$i/filezilla-wxstd.mo ; \
#	done



# ----------------------------------------------------------------------------
# Logic for catalogs updating follows
# Try to not modify catalog files if nothing has changed
# But touch them to make sure the timestamps are correct
# so that the uptodate checks are only made if neccessary.
# ----------------------------------------------------------------------------

# the programs we use (TODO: use configure to detect them)
MSGFMT=@msgfmt@ -c --verbose --no-hash
MSGMERGE=@msgmerge@
XGETTEXT=@xgettext@

# common xgettext args: C++ syntax, use the specified macro names as markers
XGETTEXT_ARGS=-C -k_ -kfztranslate:1,1t -kfztranslate:1,2,3t -kfztranslate_mark:1,1t -kfztranslate_mark:1,2,3t -kwxPLURAL:1,2 -s -j -c@translator --msgid-bugs-address='https://trac.filezilla-project.org/'

# implicit rules
%.mo: %.po.new
	$(MSGFMT) -o $@ $< || exit 1

# a PO file must be updated from wxstd.po to include new translations
%.po.new: $(srcdir)/%.po filezilla.pot
	file=$@; \
	cat $(srcdir)/$${file%.po.new}.po > $@
	if [ ! -f $@ ]; then \
	  exit 1; \
	fi
	$(MSGMERGE) $@ filezilla.pot -o $@~ || exit 1
	@mv $@~ $@

# touch file so that timestamp is newer than that of filezilla.pot
	@touch $@;

# generate resources.h from the xrc files. We have to do this since
# xgettext cannot handle xrc files. So export all translatable strings from
# the resource files into resources.h using wxrc.
resources.h: $(srcdir)/../src/interface/resources/xrc/*.xrc
	@if [ -f $@~ ]; then rm $@~; fi

	@WXRC@ -g -e $(srcdir)/../src/interface/resources/xrc/*.xrc > "$@~" || exit 1

# strip strings not marked for translation (enclosed in <>)
	cat $@~ | sed "s/_(\"<.*>\")\;//" > $@~~ || exit 1
	@mv $@~~ $@~

# In resource files we have no format specifiers
	cat $@~ | sed -e '/%/ s/$$/ \/\/xgettext:no-c-format/' > $@ || exit 1

	@if [ -f $@~ ]; then rm $@~; fi

filezilla.pot: resources.h $(srcdir)/../src/include/*.h $(srcdir)/../src/engine/*.h $(srcdir)/../src/interface/*.h  $(srcdir)/../src/engine/*.cpp $(srcdir)/../src/interface/*.cpp
	@rm -f $@.new
	@touch $@.new

	FILES="resources.h `find $(srcdir)/../src -name '*.h' -o -name '*.cpp'`"; \
	$(XGETTEXT) $(XGETTEXT_ARGS) -o $@.new $$FILES || exit 1

# change charset declaration in template file to UTF-8
	cat $@.new | sed -e "s/^\"Content-Type: .*$$/\"Content-Type: text\\/plain; charset=UTF-8\\\\n\"/" > $@.new~
	@mv $@.new~ $@.new

	if [ -f $@ ]; then \
	  touch $@; \
	  $(MSGMERGE) -U $@ $@.new || exit 1; \
	else \
	  mv $@.new $@; \
	fi;

	@if [ -f $@.pot~ ]; then rm $@~; fi
	@if [ -f $@.new ]; then rm $@.new; fi

allpo: @FILEZILLA_LINGUAS_PO_NEW@

# this target which will not be called automatically will update the .po files
updatepo: @FILEZILLA_LINGUAS_PO_NEW@
	for t in @FILEZILLA_LINGUAS@; do \
          cp $$t.po.new $(srcdir)/$$t.po || exit 1; \
        done

allmo: @FILEZILLA_LINGUAS_MO@

# on the Mac copy the .mo files into the application bundle
if MACAPPBUNDLE

noinst_DATA = $(top_builddir)/FileZilla.app/Contents/SharedSupport/locales

$(top_builddir)/FileZilla.app/Contents/SharedSupport/locales: allmo
	mkdir -p $(top_builddir)/FileZilla.app/Contents/SharedSupport/locales
	for i in @FILEZILLA_LINGUAS@ ; do \
	  mkdir -p $(top_builddir)/FileZilla.app/Contents/Resources/$$i.lproj; \
	  mkdir -p $(top_builddir)/FileZilla.app/Contents/SharedSupport/locales/$$i; \
	  cp -f $$i.mo $(top_builddir)/FileZilla.app/Contents/SharedSupport/locales/$$i/filezilla.mo; \
	done
	mkdir -p $(top_builddir)/FileZilla.app/Contents/Resources/en.lproj

endif

all: allmo

.PHONY: allpo allmo force-update FORCE