Fix repositioning of GTK windows
[xboard.git] / Makefile.am
1 bin_PROGRAMS = xboard
2
3 ### if we are compiling with ZIPPY we need some extra source files
4
5 if ZIPPY
6   ZPY = zippy.c zippy.h
7 else
8   ZPY =
9 endif
10
11 ### define sources for the front-end and backend
12 GTKsources = gtk/xboard.c    gtk/xboard.h \
13              gtk/xoptions.c  gtk/xtimer.c \
14              gtk/xengineoutput.c
15
16 Xsources   = xaw/xboard.c    xaw/xboard.h    \
17              xaw/xengineoutput.c             \
18              xaw/xgamelist.c xaw/xgamelist.h \
19              xaw/xhistory.c  xaw/xhistory.h  \
20              xaw/xoptions.c \
21              bitmaps/checkmark.bm bitmaps/icon_black.bm bitmaps/icon_white.bm
22
23 if withGTK
24   FRONTENDsources = $(GTKsources)
25   FRONTENDextras = $(Xsources)
26   headers = -I gtk
27 endif
28 if withXaw
29   FRONTENDsources = $(Xsources)
30   FRONTENDextras = $(GTKsources)
31   headers = -I xaw -DX11
32 endif
33
34 xboard_SOURCES = backend.c backend.h backendz.h \
35                  book.c \
36                  childio.c childio.h \
37                  common.h \
38                  frontend.h \
39                  gamelist.c ngamelist.c \
40                  gettext.h  \
41                  lists.c lists.h \
42                  moves.c moves.h \
43                  parser.c parser.h \
44                  pgntags.c \
45                  uci.c \
46                  args.h xboard2.h \
47                  board.c board.h \
48                  draw.c draw.h \
49                  dialogs.c dialogs.h \
50                  engineoutput.c nengineoutput.c engineoutput.h \
51                  evalgraph.c nevalgraph.c evalgraph.h \
52                  history.c nhistory.c \
53                  menus.c menus.h \
54                  usounds.c usystem.c usystem.h \
55                  $(ZPY) $(FRONTENDsources)
56
57 ###
58
59 SUBDIRS = po
60 xboard_LDADD = -lm @FRONTEND_LIBS@ @X_LIBS@ @LIBINTL@ @CAIRO_LIBS@
61
62 EXTRA_DIST = pixmaps themes png sounds winboard \
63         xboard.texi gpl.texinfo texi2man texinfo.tex xboard.man xboard.desktop xboard-config.desktop \
64         xboard-fen-viewer.desktop  xboard-pgn-viewer.desktop  xboard-tourney.desktop xboard.xml \
65         COPYRIGHT FAQ.html engine-intf.html ics-parsing.txt readme.htm zippy.README \
66         xboard.conf.in SHORTLOG DIFFSTAT history.c ABOUT-NLS $(FRONTENDextras)
67
68 DISTCLEANFILES = stamp-h
69
70 GITVERSION=$(shell sh -c 'git describe --dirty --always 2>/dev/null')
71 AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @X_CFLAGS@ @CAIRO_CFLAGS@ @FRONTEND_CFLAGS@  -DSYSCONFDIR='"$(sysconfdir)"' \
72             -DLOCALEDIR='"$(localedir)"' -DSVGDIR='"$(svgdir)"' -D__GIT_VERSION='"$(GITVERSION)"' $(headers)
73
74 ACLOCAL_AMFLAGS = -I m4
75
76 info_TEXINFOS =  xboard.texi
77 xboard_TEXINFOS =  copyright.texi
78 man6_MANS = xboard.man
79
80
81 ### config file
82
83 sysconf_DATA = xboard.conf
84
85 ### icon files
86
87 icondir = $(datadir)/icons/hicolor/48x48/apps
88 dist_icon_DATA = xboard.png
89 svgicondir = $(datadir)/icons/hicolor/scalable/apps
90 dist_svgicon_DATA = xboard.svg
91
92
93 ### desktop files for KDE and gnome
94
95 Applicationsdir = $(datadir)/applications
96 Applications_DATA = xboard.desktop xboard-fen-viewer.desktop  xboard-pgn-viewer.desktop  xboard-tourney.desktop  xboard-config.desktop
97
98 ### mime file
99 mimedir = $(datadir)/mime/packages
100 mime_DATA = xboard.xml
101
102 ### directory and files for svgs
103
104 svgdir = $(datadir)/games/xboard/themes/default
105 dist_svg_DATA = svg/icon_white.svg         svg/icon_black.svg      \
106            svg/BlackAdvisor.svg       svg/WhiteAdvisor.svg    \
107            svg/BlackArchbishop.svg    svg/WhiteArchbishop.svg  \
108            svg/BlackBishop.svg        svg/WhiteBishop.svg      \
109            svg/BlackCanon.svg         svg/WhiteCanon.svg       \
110            svg/BlackChancellor.svg    svg/WhiteChancellor.svg  \
111            svg/BlackCobra.svg         svg/WhiteCobra.svg       \
112            svg/BlackCommoner.svg      svg/WhiteCommoner.svg    \
113            svg/BlackCrownedBishop.svg svg/WhiteCrownedBishop.svg  \
114            svg/BlackCrownedRook.svg   svg/WhiteCrownedRook.svg \
115            svg/BlackElephant.svg      svg/WhiteElephant.svg    \
116            svg/BlackGoldKnight.svg    svg/WhiteGoldKnight.svg  \
117            svg/BlackGoldLance.svg   svg/WhiteGoldLance.svg    \
118            svg/BlackGoldPawn.svg    svg/WhiteGoldPawn.svg     \
119            svg/BlackGoldSilver.svg  svg/WhiteGoldSilver.svg   \
120            svg/BlackGold.svg        svg/WhiteGold.svg         \
121            svg/BlackHawk.svg        svg/WhiteHawk.svg         \
122            svg/BlackKing.svg        svg/WhiteKing.svg         \
123            svg/BlackKnight.svg      svg/WhiteKnight.svg       \
124            svg/BlackLance.svg       svg/WhiteLance.svg        \
125            svg/BlackMarshall.svg    svg/WhiteMarshall.svg     \
126            svg/BlackNightrider.svg  svg/WhiteNightrider.svg   \
127            svg/BlackPawn.svg        svg/WhitePawn.svg         \
128            svg/BlackPrincess.svg    svg/WhitePrincess.svg     \
129            svg/BlackQueen.svg       svg/WhiteQueen.svg        \
130            svg/BlackRook.svg        svg/WhiteRook.svg         \
131            svg/BlackUnicorn.svg     svg/WhiteUnicorn.svg      \
132            svg/eo_Analyzing.svg     svg/eo_Black.svg          \
133            svg/eo_Clear.svg         svg/eo_Ponder.svg         \
134            svg/eo_Thinking.svg      svg/eo_Unknown.svg        \
135            svg/eo_White.svg
136
137 shogidir = $(datadir)/games/xboard/themes/shogi
138 dist_shogi_DATA = \
139            themes/shogi/WhiteGold.svg        themes/shogi/WhiteCrownedBishop.svg\
140            themes/shogi/WhiteBishop.svg      themes/shogi/WhiteKing.svg\
141            themes/shogi/WhiteKnight.svg      themes/shogi/WhiteGoldKnight.svg\
142            themes/shogi/WhiteLance.svg       themes/shogi/WhiteGoldLance.svg\
143            themes/shogi/WhitePawn.svg        themes/shogi/WhiteGoldPawn.svg\
144            themes/shogi/WhiteRook.svg        themes/shogi/WhiteCrownedRook.svg\
145            themes/shogi/WhiteAdvisor.svg     themes/shogi/WhiteGoldSilver.svg\
146            themes/shogi/BlackGold.svg        themes/shogi/BlackCrownedBishop.svg\
147            themes/shogi/BlackBishop.svg      themes/shogi/BlackKing.svg\
148            themes/shogi/BlackKnight.svg      themes/shogi/BlackGoldKnight.svg\
149            themes/shogi/BlackLance.svg       themes/shogi/BlackGoldLance.svg\
150            themes/shogi/BlackPawn.svg        themes/shogi/BlackGoldPawn.svg\
151            themes/shogi/BlackRook.svg        themes/shogi/BlackCrownedRook.svg\
152            themes/shogi/BlackAdvisor.svg     themes/shogi/BlackGoldSilver.svg
153
154 xiangqidir = $(datadir)/games/xboard/themes/xiangqi
155 dist_xiangqi_DATA = themes/xiangqi/BlackAdvisor.svg  themes/xiangqi/WhiteAdvisor.svg \
156            themes/xiangqi/BlackCanon.svg    themes/xiangqi/WhiteCanon.svg    \
157            themes/xiangqi/BlackElephant.svg themes/xiangqi/WhiteElephant.svg \
158            themes/xiangqi/BlackKnight.svg   themes/xiangqi/WhiteKnight.svg   \
159            themes/xiangqi/BlackGold.svg     themes/xiangqi/WhiteGold.svg     \
160            themes/xiangqi/BlackPawn.svg     themes/xiangqi/WhitePawn.svg     \
161            themes/xiangqi/BlackRook.svg     themes/xiangqi/WhiteRook.svg
162
163 ### directory and files for pixmaps
164
165 pixmapsdir = $(datadir)/games/xboard/pixmaps/textures
166 dist_pixmaps_DATA = pixmaps/cross32.xpm pixmaps/cross48.xpm pixmaps/board32.xpm pixmaps/board48.xpm pixmaps/ini32.xpm pixmaps/ini48.xpm
167
168 ### directory and files for pngs
169
170 pngdir = $(datadir)/games/xboard/themes/textures
171 dist_png_DATA = png/hatch.png png/wood_d.png png/wood_l.png png/xqboard.png
172
173 ### directory and files for sound files
174
175 soundsdir = $(datadir)/games/xboard/sounds
176 dist_sounds_DATA = \
177   sounds/cymbal.wav     sounds/pop2.wav   sounds/slap.wav     sounds/ding1.wav      sounds/laser.wav \
178   sounds/woodthunk.wav  sounds/gong.wav   sounds/penalty.wav  sounds/honkhonk.wav   sounds/phone.wav
179
180
181 ### set correct dir in xboard.conf
182
183 edit = sed -e 's|@pngdir[@]|$(pngdir)|g' \
184            -e 's|@soundsdir[@]|$(soundsdir)|g'
185
186 xboard.conf: Makefile $(srcdir)/xboard.conf.in
187         @echo '  'GEN '  ' $@;
188         @rm -f $@ $@.tmp
189         @$(edit) $(srcdir)/$@.in >$@.tmp
190         @mv $@.tmp $@
191
192 distclean-local:
193         -rm -f xboard.conf
194
195 ### the man page depends on several files, so we add a special rule
196
197 xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi
198         $(srcdir)/texi2man $(srcdir)/xboard.texi > xboard.man || (rm -f xboard.man ; false)
199
200 ### install mime-type files and corresponding icons and menu entries if enabled during configure
201
202 install-data-hook: install-mime-database
203 uninstall-hook: uninstall-mime-database
204
205 install-mime-database:
206 if ENABLE_UPDATE_MIMEDB
207         -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \
208                 $(XDG_MIME) install --mode system --novendor xboard.xml ;\
209                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-pgn-viewer.desktop;\
210                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-fen-viewer.desktop;\
211                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-tourney.desktop;\
212                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-config.desktop;\
213                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/board32.xpm application-x-chess-pgn;\
214                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/cross32.xpm application-x-xboard-trn;\
215                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/ini32.xpm application-x-xboard-opt;\
216                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/board48.xpm application-x-chess-pgn;\
217                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/cross48.xpm application-x-xboard-trn;\
218                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/ini48.xpm application-x-xboard-opt;\
219         fi
220 endif
221
222 uninstall-mime-database:
223 if ENABLE_UPDATE_MIMEDB
224         -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \
225                 $(XDG_MIME) uninstall --mode system --novendor xboard.xml;\
226                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-pgn-viewer.desktop;\
227                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-fen-viewer.desktop;\
228                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-tourney.desktop;\
229                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-config.desktop;\
230                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 board32.xpm application-x-chess-pgn;\
231                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 cross32.xpm application-x-xboard-trn;\
232                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 ini32.xpm application-x-xboard-opt;\
233                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 board48.xpm application-x-chess-pgn;\
234                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 cross48.xpm application-x-xboard-trn;\
235                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 ini48.xpm application-x-xboard-opt;\
236         fi
237 endif