1##############################################################################
2# pgAdmin III - PostgreSQL Tools
3#
4# Copyright (C) 2002 - 2016, The pgAdmin Development Team
5# This software is released under the PostgreSQL Licence
6#
7# Makefile - Makefile for *nix systems
8##############################################################################
9
10AUTOMAKE_OPTIONS = foreign
11
12SUBDIRS = branding i18n plugins.d xtra pgadmin pkg
13
14EXTRA_DIST = \
15	$(top_srcdir)/BUGS \
16	$(top_srcdir)/CHANGELOG \
17	$(top_srcdir)/DEVELOPERS \
18	$(top_srcdir)/INSTALL \
19	$(top_srcdir)/LICENSE \
20	$(top_srcdir)/README \
21	$(top_srcdir)/TODO \
22	$(top_srcdir)/bootstrap \
23	$(top_srcdir)/configure.ac.in \
24	$(top_srcdir)/config.rpath.in \
25	$(top_srcdir)/languages.hwx \
26	$(top_srcdir)/languages.po \
27	$(top_srcdir)/pgadmin3.pot \
28	$(top_srcdir)/pgadmin3-release.pot \
29	$(top_srcdir)/pgAdmin3.props \
30	$(top_srcdir)/pgAdmin3.targets \
31	$(top_srcdir)/pgAdmin3.xml \
32	$(top_srcdir)/pgAdmin3.sln \
33	$(top_srcdir)/stringextract \
34	$(top_srcdir)/stringmerge \
35	$(top_srcdir)/docs/Docs.vcxproj \
36	$(top_srcdir)/docs/Docs.vcxproj.filters \
37	$(top_srcdir)/docs/builddocs.bat \
38	$(top_srcdir)/docs/createConf.vbs \
39	$(top_srcdir)/docs/en_US/*.rst \
40	$(top_srcdir)/docs/en_US/conf.py \
41	$(top_srcdir)/docs/en_US/conf.py.in \
42	$(top_srcdir)/docs/en_US/make.bat \
43	$(top_srcdir)/docs/en_US/Makefile.sphinx \
44	$(top_srcdir)/docs/en_US/images/*.png
45
46TMP_docs = \
47	$(top_srcdir)/docs/en_US/*.css \
48	$(top_srcdir)/docs/en_US/hints/*.html \
49	$(top_srcdir)/docs/cs_CZ/*.css \
50	$(top_srcdir)/docs/cs_CZ/hints/*.html \
51	$(top_srcdir)/docs/de_DE/*.css \
52	$(top_srcdir)/docs/de_DE/hints/*.html \
53	$(top_srcdir)/docs/es_ES/*.css \
54	$(top_srcdir)/docs/es_ES/hints/*.html \
55	$(top_srcdir)/docs/fi_FI/*.css \
56	$(top_srcdir)/docs/fi_FI/hints/*.html \
57	$(top_srcdir)/docs/fr_FR/*.css \
58	$(top_srcdir)/docs/fr_FR/hints/*.html \
59	$(top_srcdir)/docs/sl_SI/*.css \
60	$(top_srcdir)/docs/sl_SI/hints/*.html \
61	$(top_srcdir)/docs/zh_CN/*.css \
62	$(top_srcdir)/docs/zh_CN/hints/*.html \
63	$(top_srcdir)/docs/zh_TW/*.css \
64	$(top_srcdir)/docs/zh_TW/hints/*.html
65
66if !APPBUNDLE
67nobase_dist_pkgdata_DATA = $(TMP_docs)
68help_dir = $(DESTDIR)/$(pkgdatadir)
69else
70nobase_dist_data_DATA = $(TMP_docs)
71help_dir = $(DESTDIR)/$(datadir)
72endif
73
74install-data-hook:
75if SPHINX_BUILD
76	if [ -d $(top_srcdir)/docs/en_US/_build/htmlhelp ]; then cp -R $(top_srcdir)/docs/en_US/_build/htmlhelp/* $(help_dir)/docs/en_US/; fi
77
78# Fix up the charset so wxWidgets doesn't bleat
79	for f in `ls $(help_dir)/docs/en_US/*.html`; do LANG=C sed "s/iso8859_1/iso8859\-1/g" $$f > temp; mv temp $$f; done
80endif
81
82# Perform astyle cleanup per rules:
83# * -p - insert space around parenthesis
84# * --style=allman - bracket style
85# * -S - indent switches
86# * -t4 - intent with tabs, 4 of them
87# * -k3 - align pointer or reference operators
88# * -z2 - Unix style line endings
89# Also add the -n to make it not save .orig files (we have git for that)
90style:
91	astyle -n -p --style=allman -S -t4 -k3 -z2 `find . -name "*.cpp" -o -name "*.h" | egrep -v "(wx-build|xrcDialogs|pgadmin/libssh2|pgadmin/include/libssh2)"`
92
93# Create HTML docs
94doc:
95if SPHINX_BUILD
96	cd $(top_srcdir)/docs/en_US && $(MAKE) -f Makefile.sphinx SPHINXBUILD=${SPHINX_BUILD} htmlhelp
97endif
98
99xrc:
100	$(top_srcdir)/pgadmin/ui/embed-xrc
101
102all: doc xrc
103
104clean-local:
105	rm -rf $(top_srcdir)/docs/en_US/_build
106