-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathRules-nsis
53 lines (44 loc) · 1.93 KB
/
Rules-nsis
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
# Rules-nsis - Special Makefile rules for NSIS msg catalogs. -*- Makefile -*-
# Copyright (C) 2007 g10 Code GmbH
#
# This file is part of GPG4Win.
#
# GPG4Win is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# GPG4Win is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
NSIFILES = $(GMOFILES:.gmo=.nsi)
DISTFILES.extra1 = nsis-xgettext.sh nsis-xgettext.awk nsis-msgfmt.c \
$(NSIFILES) Rules-nsis build-cc.in README.nsis
.SUFFIXES: .nsi
# We build this little utility on the BUILD architecture!
nsis-msgfmt: nsis-msgfmt.c
$$(cat $(srcdir)/build-cc) -o nsis-msgfmt $(srcdir)/nsis-msgfmt.c -lgettextpo
# We extend the GMO file mechanism to also handle NSIS files.
$(GMOFILES): %.gmo: %.nsi
%.nsi : %.po
$(MAKE) nsis-msgfmt
@lang=`echo $* | sed -e 's,.*/,,'`; \
test "$(srcdir)" = . && dir="" || dir="$(srcdir)/"; \
echo "rm -f $${dir}$${lang}.nsi && ./nsis-msgfmt $${dir}$${lang}.po > $${dir}$${lang}.nsi"; \
rm -f $${dir}$${lang}.nsi && ./nsis-msgfmt $${dir}$${lang}.po > $${dir}t-$${lang}.nsi && mv $${dir}t-$${lang}.nsi $${dir}$${lang}.nsi
# Collect all NSI files we need to include.
catalogs.nsi: $(GMOFILES)
echo -n $(CATALOGS) \
| sed -e 's/\([^ ]*\).gmo */!include "\1.nsi"\n/g' > catalogs.nsi
all: catalogs.nsi
mostlyclean: mostlyclean-nsis
mostlyclean-nsis:
rm -f nsis-msgfmt catalogs.nsi
maintainer-clean: maintainer-clean-nsis
maintainer-clean-nsis:
rm -f *.nsi