1SUBDIRS=admin data m4 src plugins tools gui test po doc checks
2DIST_SUBDIRS=admin data m4 src plugins tools gui test doc po checks
3
4
5AUTOMAKE_OPTIONS = foreign
6
7EXTRA_DIST = config.rpath  \
8 ChangeLog \
9 README.W32 \
10 README.DARWIN \
11 README.SOLARIS \
12 RELEASES \
13 gwenhywfar.spec \
14 Makefile.cvs \
15 i18nsources
16
17bin_SCRIPTS = gwenhywfar-config
18M4dir = $(datadir)/aclocal
19dist_M4_DATA = gwenhywfar.m4
20ACLOCAL_AMFLAGS = -I m4
21
22$(gwenhywfar_symlinkdir)/gwenhywfar/version.h: $(top_builddir)/src/version.h
23	make -C ` dirname $< ` ` basename $< `
24	( cd $(gwenhywfar_symlinkdir)/gwenhywfar && $(LN_S) -f ../../$< ` basename $@ ` )
25$(gwenhywfar_symlinkdir)/gwenhywfar/types.h: $(top_builddir)/src/types.h
26	make -C ` dirname $< ` ` basename $< `
27	( cd $(gwenhywfar_symlinkdir)/gwenhywfar && $(LN_S) -f ../../$< ` basename $@ ` )
28$(gwenhywfar_symlinkdir)/gwenhywfar/system.h: $(top_builddir)/src/os/$(OS_TYPE)/system.h
29	make -C ` dirname $< ` ` basename $< `
30	( cd $(gwenhywfar_symlinkdir)/gwenhywfar && $(LN_S) -f ../../$< ` basename $@ ` )
31
32BUILT_SOURCES = $(gwenhywfar_symlinkdir)/gwenhywfar/version.h $(gwenhywfar_symlinkdir)/gwenhywfar/types.h $(gwenhywfar_symlinkdir)/gwenhywfar/system.h
33
34gwenhywfar-config: gwenhywfar-config.in
35	echo "#! /bin/sh" >gwenhywfar-config && \
36	echo 'dir="@prefix@"' >>gwenhywfar-config && \
37	cat gwenhywfar-config.in >>gwenhywfar-config && \
38	chmod a+x gwenhywfar-config
39
40pkgconfigdir = $(libdir)/pkgconfig
41pkgconfig_DATA = gwenhywfar.pc
42
43cmakeconfigdir = $(libdir)/cmake/gwenhywfar-@GWENHYWFAR_VERSION_MAJOR@.@GWENHYWFAR_VERSION_MINOR@
44cmakeconfig_DATA = gwenhywfar-config.cmake gwenhywfar-config-version.cmake
45
46CLEANFILES = gwenhywfar-config $(PACKAGE).tag listdoc.h
47DISTCLEANFILES = gwenhywfar-config.in
48
49distclean-local: distclean-local-check
50.PHONY: distclean-local
51distclean-local-check:
52	rm -rf apidoc gwenhywfar5
53
54listdoc.h: $(top_builddir)/admin/mklistdoc
55	admin/mklistdoc -v -I $(top_srcdir)/src/base `find "$(top_builddir)/gwenhywfar5/gwenhywfar" -name "*.h" | LC_ALL=C sort` >listdoc.h
56
57$(top_builddir)/admin/mklistdoc:
58	$(MAKE) -C "$(top_builddir)/admin" mklistdoc
59
60srcdoc: Doxyfile listdoc.h
61	doxygen
62
63$(PACKAGE).tag: Doxyfile listdoc.h
64	doxygen
65
66install-srcdoc: $(PACKAGE).tag
67	test -d "$(DESTDIR)@docpath@/$(PACKAGE)" || \
68	  mkdir -p "$(DESTDIR)@docpath@/$(PACKAGE)"
69	for f in apidoc/*; do \
70	  cp -dR $$f "$(DESTDIR)@docpath@/$(PACKAGE)/"; \
71	done
72	cp "$(PACKAGE).tag" "$(DESTDIR)@docpath@/"
73	if test -x "$(DESTDIR)@docpath@/$(PACKAGE)/installdox"; then \
74	  cd "$(DESTDIR)@docpath@/$(PACKAGE)" && \
75	   ID_OPT="-q" ; \
76	   for ff in ${DOXYGEN_TAGFILES}; do \
77	    ID_OPT="$$ID_OPT -l `basename $$ff`@../`basename $$ff | $(SED) -e s/.tag//`";\
78	   done ;\
79	   ( cd "$(DESTDIR)@docpath@/$(PACKAGE)" && \
80	      ./installdox -q $$ID_OPT \
81	   ); \
82	fi
83
84
85rpm:    $(PACKAGE).spec dist
86	rpmbuild="rpm" && \
87	if [ `rpm --version | awk '{ print $$3 }'` > /dev/null ]; then rpmbuild="rpmbuild"; fi && \
88	$$rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz
89
90# Rule for using the Inno Setup compiler. The path to iscc.exe is
91# set manually here for now and can be overridden if you set an
92# env variable with the same name.
93ISCC = "C:\Program Files\Inno Setup 5\iscc.exe"
94wintmpdir = distribution
95setup: gwenhywfar.iss
96	mkdir -p $(wintmpdir)
97	make prefix="`pwd`/$(wintmpdir)/usr" \
98	     WIN_PATH_WINDOWS_MINGW="`pwd`/$(wintmpdir)/usr/windows" \
99	     install \
100	 && $(ISCC) gwenhywfar.iss \
101	 && rm -rf $(wintmpdir)
102
103
104# Rule for only building the source rpm
105srpm: $(PACKAGE).spec dist
106	rpmbuild="rpm" && \
107	if [ `rpm --version | awk '{ print $$3 }'` > /dev/null ]; then rpmbuild="rpmbuild"; fi && \
108	$$rpmbuild --nodeps -ts $(PACKAGE)-$(VERSION).tar.gz
109
110
111
112if IF_MAKE_I18N_FILES
113
114# We directly read that file list. For old make programs, you would
115# set this to an empty variable, because they are only needed by the
116# developers and release technicians.
117I18NFILES=$(shell cat $(srcdir)/i18nsources)
118DLGFILES=$(shell cat $(srcdir)/dlgsources)
119PDFILES=$(shell cat $(srcdir)/pdsources)
120
121# Current build rule:
122sources:
123	rm -f $(srcdir)/i18nsources $(srcdir)/dlgsources
124	for d in $(SUBDIRS); do \
125	  $(MAKE) -C $$d sources; \
126	done
127
128static-sources:
129	rm -f $(srcdir)/i18nsources $(srcdir)/dlgsources $(srcdir)/pdsources
130	for d in src plugins; do \
131	  $(MAKE) -C $$d sources; \
132	done
133
134$(srcdir)/i18nsources $(srcdir)/dlgsources $(srcdir)/pdsources:
135	$(MAKE) sources
136
137# Could also be solved this way: Read the I18NFILES variable from file
138#include $(srcdir)/i18nsources
139# (Needs the following build rule:)
140#sources:
141#	rm -f $(srcdir)/i18nsources
142#	make -C $(top_srcdir)/src sources
143#	mv $(srcdir)/i18nsources $(srcdir)/i18nsources.tmp
144#	echo "I18NFILES = \\" > $(srcdir)/i18nsources
145#	$(SED) 's!\(^.*$$\)!$$(top_srcdir)/\1 \\!' \
146#	  $(srcdir)/i18nsources.tmp >> $(srcdir)/i18nsources
147#	echo '$$(top_srcdir)/config.h' >> $(srcdir)/i18nsources
148#	rm -f $(srcdir)/i18nsources.tmp
149#	make Makefile
150
151# The list of available languages (makes file name transformations much easier)
152ALL_LINGUAS = $(basename $(notdir $(shell ls $(srcdir)/po/*.po)))
153# For old make programs, the locales would directly be written here:
154#ALL_LINGUAS = de
155
156# List of po files. Only necessary in the dependency of the catalogs
157# rule. For old make programs, you would simpy set this to an empty
158# variable.
159I18NLINGUAS = $(foreach lang,$(ALL_LINGUAS),$(srcdir)/po/$(lang).po)
160
161# List of mo files. Only necessary for cleanup. For old make programs,
162# you would simply set this to an empty variable.
163I18NCATALOGS = $(foreach lang,$(ALL_LINGUAS),$(top_builddir)/po/$(lang).mo)
164
165
166po/$(PACKAGE).pot: i18nsources dlgsources pdsources $(I18NFILES)
167	rm -f po/tmp*
168	if test -n "$(I18NFILES)"; then \
169	  $(XGETTEXT) -C -c -ki18n -ktr2i18n -kI18N -kI18S\
170	    -kI18N_NOOP -ktranslate -kaliasLocale \
171            -ktr -ktrUtf8 \
172	    '--msgid-bugs-address=aqbanking-user@lists.aqbanking.de' \
173	    -o po/tmppot \
174	    $(I18NFILES) ; \
175	fi
176	for i in $(DLGFILES); do \
177          po4a-gettextize -f xml -m $$i -p po/tmppot1 -o attributes=text && \
178	  msghack -o po/tmppot2 --append po/tmppot po/tmppot1 && \
179	  mv po/tmppot2 po/tmppot; \
180	done
181	for i in $(PDFILES); do \
182          po4a-gettextize -f xml -m $$i -p po/tmppot1 -o wrap \
183	    -o translated="<plugin><short> <plugin><descr>" \
184	    -o untranslated="<plugin><version> <plugin><author>" \
185	    && \
186	  msghack -o po/tmppot2 --append po/tmppot po/tmppot1 && \
187	  mv po/tmppot2 po/tmppot; \
188	done
189	mv po/tmppot po/$(PACKAGE).pot
190	rm -f po/tmppot1
191
192
193# This rule is called automatically at install time. However, it is
194# necessary only for the translators, so maybe it shouldn't be called
195# at install time.
196merge: po/$(PACKAGE).pot
197	@catalogs=$(I18NLINGUAS); \
198	for cat in $$catalogs; do \
199	echo msgmerge -o $$cat.new $$cat ./po/$(PACKAGE).pot ; \
200	msgmerge -o $$cat.new $$cat ./po/$(PACKAGE).pot ; \
201	if test -s $$cat.new; then \
202	  grep -v "\"POT-Creation" $$cat.new > $$cat.new.2 ; \
203	  grep -v "\"POT-Creation" $$cat >> $$cat.new.1; \
204	  if diff $$cat.new.1 $$cat.new.2; then \
205		echo "  $$cat unchanged; leaving existing po file untouched."; \
206		rm $$cat.new;  \
207	  else  \
208		mv $$cat.new $$cat ; \
209	fi; \
210	rm -f $$cat.new.1 $$cat.new.2 ;\
211	fi ;\
212	done
213
214catalogs: $(I18NLINGUAS)
215	@for i in $(ALL_LINGUAS); do \
216	  filelingua=$(srcdir)/po/$$i.po; \
217	  filecat=$(top_builddir)/po/$$i.mo; \
218	  echo "Creating translation catalogs for language \"$$i\""; \
219	  echo $(MSGFMT) -o $${filecat} $${filelingua} ; \
220	  $(MSGFMT) -o $${filecat} $${filelingua} || touch $${filelingua}; \
221	done
222
223CLEANFILES += $(I18NCATALOGS)
224
225install-mo-catalogs: catalogs
226	@for i in $(ALL_LINGUAS); do \
227	  filecat=$(top_builddir)/po/$$i.mo; \
228          echo "Installing translation catalog for language \"$$i\""; \
229          $(mkinstalldirs) "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES"; \
230          echo $(INSTALL_DATA) $${filecat} $(DESTDIR)$(localedir)/$$i/LC_MESSAGES/$(PACKAGE).mo; \
231          $(INSTALL_DATA) $${filecat} $(DESTDIR)$(localedir)/$$i/LC_MESSAGES/$(PACKAGE).mo; \
232        done
233uninstall-mo-catalogs:
234	@$(NORMAL_UNINSTALL)
235	@for i in $(ALL_LINGUAS); do \
236	  echo " rm -f '$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/$(PACKAGE).mo'"; \
237	  rm -f "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/$(PACKAGE).mo"; \
238	done
239
240install-data-local: install-mo-catalogs
241uninstall-local: uninstall-mo-catalogs
242
243
244endif
245
246
247format:
248	find . -name '*.[c,h,cpp]' -exec $(ASTYLE) \
249	  --style=stroustrup \
250	    -s2 \
251	    --min-conditional-indent=0 \
252	    --indent-labels \
253	    --max-continuation-indent=80 \
254	    --pad-comma \
255	    --pad-header \
256	    --unpad-paren \
257	    --align-pointer=name \
258	    --break-closing-braces \
259	    --break-one-line-headers \
260	    --attach-return-type \
261	    --convert-tabs \
262	    --max-code-length=120 \
263	    --break-after-logical \
264	    --preserve-date \
265	    --suffix=none \{\} \;
266
267cppcheck:
268	for f in `find . -name \*.c -o -name \*.cpp`; do cppcheck $$f; done
269
270ChangeLog:
271	if test -d .git; then \
272	  git log --pretty="format:------------------------------------------------------------------%n%ai %an%n%s%n%b" -n 100 >ChangeLog ;\
273	else \
274	  touch ChangeLog; \
275	fi
276
277dist-hook:
278	rm -f ChangeLog 2>/dev/null
279	$(MAKE) ChangeLog
280