forked from aqbanking/aqbanking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
292 lines (238 loc) · 8.76 KB
/
Makefile.am
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
SUBDIRS=admin doc m4 src po @TUTORIALS@
DIST_SUBDIRS=admin doc m4 src po tutorials
EXTRA_DIST=AUTHORS COPYING ChangeLog INSTALL NEWS README \
aqbanking.spec.in aqbanking.spec \
aqbanking.iss.in aqbanking.iss \
Doxyfile.in \
i18nsources \
mksymlinks.sh.in mksymlinks.sh Makefile.cvs
idatadir=${datadir}/doc/aqbanking
idata_DATA=AUTHORS COPYING ChangeLog README
bin_SCRIPTS=aqbanking-config
aclocaldir = $(datadir)/aclocal
dist_aclocal_DATA = aqbanking.m4
ACLOCAL_AMFLAGS = $(ADD_ACLOCAL_FLAGS) -I m4
CLEANFILES = aqbanking-config aqbanking-config.in
aqbanking-config: aqbanking-config.in
echo "#! /bin/sh" >aqbanking-config && \
echo 'dir="@prefix@"' >>aqbanking-config && \
cat aqbanking-config.in >>aqbanking-config && \
chmod a+x aqbanking-config
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = aqbanking.pc
cmakeconfigdir = $(libdir)/cmake/aqbanking-$(AQBANKING_VERSION_MAJOR).$(AQBANKING_VERSION_MINOR)
cmakeconfig_DATA = aqbanking-config.cmake aqbanking-config-version.cmake
listdoc.h:
$(gwenhywfar_bindir)/mklistdoc -I $(gwenhywfar_headers) -v `find $(aqbanking_symlinkdir) -name '*.h' | LC_ALL=C sort ` >listdoc.h
srcdoc: Doxyfile listdoc.h
if test -d apidoc; then rm -Rf apidoc; fi
mkdir -p apidoc/html/aqbanking-@AQBANKING_VERSION_RELEASE_STRING@
doxygen
install-srcdoc: srcdoc
test -d "$(DESTDIR)@docpath@/$(PACKAGE)" || \
mkdir -p "$(DESTDIR)@docpath@/$(PACKAGE)"
for f in apidoc/html/aqbanking-@AQBANKING_VERSION_RELEASE_STRING@/*; do \
cp -dR $$f "$(DESTDIR)@docpath@/$(PACKAGE)/"; \
done
cp "apidoc/$(PACKAGE).tag" "$(DESTDIR)@docpath@/"
rpm: $(PACKAGE).spec dist
rpmbuild="rpm" && \
if [ `rpm --version | awk '{ print $$3 }'` > /dev/null ]; then rpmbuild="rpmbuild"; fi && \
$$rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz
# Rule for using the Inno Setup compiler. The path to iscc.exe is set
# manually here for now.
ISCC = "C:\Programme\Inno Setup 5\iscc.exe"
wintmpdir = win32-tmp
setup: aqbanking.iss
mkdir -p $(wintmpdir)
for A in `find src/plugins -name *.la`; do \
grep -v relink_command $${A} > $${A}.tmp && \
mv $${A}.tmp $${A}; \
done
$(MAKE) DESTDIR="`pwd`/$(wintmpdir)" \
aqbanking_pkgdatadir="/share/$(PACKAGE)" \
gwenhywfar_plugins="/gwen" \
WIN_PATH_WINDOWS_MINGW="/windows" \
install \
&& for A in `find $(wintmpdir) -name '*.exe'`; do \
strip $${A}; \
done \
&& $(ISCC) aqbanking.iss \
&& rm -rf $(wintmpdir)
if IF_MAKE_I18N_FILES
# We directly read that file list. For old make programs, you would
# set this to an empty variable, because they are only needed by the
# developers and release technicians.
I18NFILES=$(shell cat $(srcdir)/i18nsources)
DLGFILES=$(shell cat $(srcdir)/dlgsources)
PDFILES=$(shell cat $(srcdir)/pdsources)
# Current build rule:
sources:
rm -f $(srcdir)/i18nsources $(srcdir)/dlgsources $(srcdir)/pdsources
$(MAKE) -C $(top_builddir)/src sources
$(srcdir)/i18nsources $(srcdir)/dlgsources $(srcdir)/pdsources:
$(MAKE) sources
# Could also be solved this way: Read the I18NFILES variable from file
#include $(srcdir)/i18nsources
# (Needs the following build rule:)
#sources:
# rm -f $(srcdir)/i18nsources
# $(MAKE) -C $(top_srcdir)/src sources
# mv $(srcdir)/i18nsources $(srcdir)/i18nsources.tmp
# echo "I18NFILES = \\" > $(srcdir)/i18nsources
# $(SED) 's!\(^.*$$\)!$$(top_srcdir)/\1 \\!' \
# $(srcdir)/i18nsources.tmp >> $(srcdir)/i18nsources
# echo '$$(top_srcdir)/config.h' >> $(srcdir)/i18nsources
# rm -f $(srcdir)/i18nsources.tmp
# $(MAKE) Makefile
# The list of available languages (makes file name transformations much easier)
ALL_LINGUAS = $(basename $(notdir $(shell ls $(srcdir)/po/*.po)))
# For old make programs, the locales would directly be written here:
#ALL_LINGUAS = de
# List of po files. Only necessary in the dependency of the catalogs
# rule. For old make programs, you would simpy set this to an empty
# variable.
I18NLINGUAS = $(foreach lang,$(ALL_LINGUAS),$(srcdir)/po/$(lang).po)
# List of mo files. Only necessary for cleanup. For old make programs,
# you would simply set this to an empty variable.
I18NCATALOGS = $(foreach lang,$(ALL_LINGUAS),$(top_builddir)/po/$(lang).mo)
I18NCATALOGS += $(foreach lang,$(ALL_LINGUAS),$(top_builddir)/po/$(lang).qm)
po/$(PACKAGE).pot: i18nsources dlgsources pdsources $(I18NFILES)
rm -f po/tmp*
if test -n "$(I18NFILES)"; then \
$(XGETTEXT) -C -c -ki18n -ktr2i18n -kI18N -kI18S\
-kI18N_NOOP -ktranslate -kaliasLocale \
-ktr -ktrUtf8 \
'--msgid-bugs-address=aqbanking-user@lists.aqbanking.de' \
-o po/tmppot \
$(I18NFILES) ; \
fi
for i in $(DLGFILES); do \
po4a-gettextize -f xml -m $$i -p po/tmppot1 -o attributes=text && \
msghack -o po/tmppot2 --append po/tmppot po/tmppot1 && \
mv po/tmppot2 po/tmppot; \
done
for i in $(PDFILES); do \
po4a-gettextize -f xml -m $$i -p po/tmppot1 -o wrap \
-o translated="<plugin><short> <plugin><descr>" \
-o untranslated="<plugin><version> <plugin><author>" \
&& \
msghack -o po/tmppot2 --append po/tmppot po/tmppot1 && \
mv po/tmppot2 po/tmppot; \
done
mv po/tmppot po/$(PACKAGE).pot
rm -f po/tmppot1
# This rule is not called automatically. It is necessary only for
# the translators, so translators only call this manually.
merge: po/$(PACKAGE).pot
@catalogs=$(I18NLINGUAS); \
for cat in $$catalogs; do \
echo msgmerge -o $$cat.new $$cat ./po/$(PACKAGE).pot ; \
msgmerge -o $$cat.new $$cat ./po/$(PACKAGE).pot ; \
if test -s $$cat.new; then \
grep -v "\"POT-Creation" $$cat.new | grep -v '^#' > $$cat.new.2 ; \
grep -v "\"POT-Creation" $$cat | grep -v '^#' >> $$cat.new.1; \
if diff $$cat.new.1 $$cat.new.2; then \
echo " $$cat unchanged; leaving existing po file untouched."; \
rm $$cat.new; \
else \
mv $$cat.new $$cat ; \
fi; \
rm -f $$cat.new.1 $$cat.new.2 ;\
fi ;\
done
catalogs: $(I18NLINGUAS)
@for i in $(ALL_LINGUAS); do \
filelingua=$(srcdir)/po/$$i.po; \
filecat=$(top_builddir)/po/$$i.mo; \
fileqm=$(top_builddir)/po/$$i.qm; \
echo "Creating translation catalogs for language \"$$i\""; \
$(MSGFMT) -c -o $${filecat} $${filelingua} || touch $${filelingua}; \
if test $(MSGFMT_SUPPORTS_QT) = "yes"; then \
$(MSGFMT) -o $${fileqm} --qt $${filelingua} || touch $${filelingua}; \
else \
echo "$(MSGFMT) does not have the option --qt; ignoring qt translations"; \
fi; \
done
ilocaledir = $(datadir)/locale
install-mo-catalogs: catalogs
@for i in $(ALL_LINGUAS); do \
filecat=$(top_builddir)/po/$$i.mo; \
fileqm=$(top_builddir)/po/$$i.qm; \
echo "Installing translation catalog for language \"$$i\""; \
$(mkinstalldirs) "$(DESTDIR)$(ilocaledir)/$$i/LC_MESSAGES"; \
$(INSTALL_DATA) $${filecat} $(DESTDIR)$(ilocaledir)/$$i/LC_MESSAGES/$(PACKAGE).mo; \
done
uninstall-mo-catalogs:
@$(NORMAL_UNINSTALL)
@for i in $(ALL_LINGUAS); do \
echo " rm -f '$(DESTDIR)$(ilocaledir)/$$i/LC_MESSAGES/$(PACKAGE).mo'"; \
rm -f "$(DESTDIR)$(ilocaledir)/$$i/LC_MESSAGES/$(PACKAGE).mo"; \
done
install-data-local: install-mo-catalogs
uninstall-local: uninstall-mo-catalogs
CLEANFILES += $(I18NCATALOGS)
endif # if USE_I18N
# Rule for only building the source rpm
srpm: $(PACKAGE).spec dist
rpmbuild="rpm" && \
if [ `rpm --version | awk '{ print $$3 }'` > /dev/null ]; then rpmbuild="rpmbuild"; fi && \
$$rpmbuild --nodeps -ts $(PACKAGE)-$(VERSION).tar.gz
BUILT_SOURCES = $(iheader_HEADERS) sl-headers
CLEANFILES += $(BUILT_SOURCES)
symlinks: mksymlinks.sh
# ${SHELL} mksymlinks.sh $(srcdir) $(builddir)
sl-headers: mksymlinks.sh
$(MAKE) -C src built_sources
# ${SHELL} mksymlinks.sh $(srcdir) $(builddir)
# Call this to have Qt's uic files and glade files cleaned up from
# bad elements
code-cleanup:
-admin/fixuifiles
-admin/glade-fixup
#cppcheck:
# $(MAKE) -C src cppcheck
cppcheck:
for f in `find . -name \*.c -o -name \*.cpp`; do cppcheck --force $$f; done
clang-check:
scan-build $(MAKE)
format:
find . -name '*.[c,h,cpp]' -exec $(ASTYLE) \
--style=stroustrup \
-s2 \
--min-conditional-indent=0 \
--indent-labels \
--max-continuation-indent=100 \
--pad-comma \
--pad-header \
--unpad-paren \
--align-pointer=name \
--break-closing-braces \
--break-one-line-headers \
--attach-return-type \
--convert-tabs \
--max-code-length=120 \
--break-after-logical \
--preserve-date \
--suffix=none \{\} \;
ChangeLog:
if test -d .git; then \
git log --pretty="format:------------------------------------------------------------------%n%ai %an%n%s%n%b" -n 100 >ChangeLog ;\
else \
touch ChangeLog; \
fi
dist-hook:
rm -f ChangeLog 2>/dev/null
$(MAKE) ChangeLog
types:
for d in $(SUBDIRS); do \
$(MAKE) -C $$d typefiles; \
done
typefiles:
for d in $(SUBDIRS); do \
$(MAKE) -C $$d typefiles; \
done
typedefs:
for d in $(SUBDIRS); do \
$(MAKE) -C $$d typedefs; \
done