Fix clock highlighting
[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
13 GTKsources = gtk/xboard.c  gtk/xboard.h \
14              gtk/xoptions.c  gtk/xtimer.c \
15              gtk/xengineoutput.c
16
17 Xsources   = xaw/xboard.c xaw/xboard.h \
18              xaw/xengineoutput.c \
19              xaw/xgamelist.c xaw/xgamelist.h \
20              xaw/xhistory.c xaw/xhistory.h \
21              xaw/xoptions.c
22              
23
24 backendsources = backend.c backend.h backendz.h \
25                  book.c \
26                  childio.c childio.h \
27                  common.h \
28                  frontend.h \
29                  gamelist.c ngamelist.c \
30                  gettext.h  \
31                  lists.c lists.h \
32                  moves.c moves.h \
33                  parser.c parser.h \
34                  pgntags.c \
35                  uci.c \
36                  args.h xboard2.h \
37                  board.c board.h \
38                  draw.c draw.h \
39                  dialogs.c dialogs.h \
40                  engineoutput.c nengineoutput.c engineoutput.h \
41                  evalgraph.c nevalgraph.c evalgraph.h \
42                  history.c nhistory.c \
43                  menus.c menus.h \
44                  usounds.c usystem.c usystem.h \
45                  $(ZPY)
46
47 ### combine sources depending on front-end
48
49 if withGTK
50   xboard_SOURCES = $(backendsources) $(GTKsources)
51   headers = -I gtk
52 endif
53 if withXaw
54   xboard_SOURCES = $(backendsources) $(Xsources)
55   headers = -I xaw -DX11
56 endif
57
58 ###
59
60 SUBDIRS = po
61 xboard_LDADD = -lm @X_LIBS@ @LIBINTL@ @FRONTEND_LIBS@ @CAIRO_LIBS@
62
63 EXTRA_DIST = pixmaps shogi png sounds winboard \
64         xboard.texi gpl.texinfo texi2man texinfo.tex xboard.man xboard.desktop \
65         xboard-fen-viewer.desktop  xboard-pgn-viewer.desktop  xboard-tourney.desktop xboard.xml \
66         COPYRIGHT FAQ.html engine-intf.html ics-parsing.txt readme.htm zippy.README \
67         xboard.conf.in SHORTLOG DIFFSTAT history.c ABOUT-NLS
68
69 DISTCLEANFILES = stamp-h
70
71 AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @CAIRO_CFLAGS@ @FRONTEND_CFLAGS@  -DSYSCONFDIR='"$(sysconfdir)"' \
72             -DLOCALEDIR='"$(localedir)"' -DSVGDIR='"$(svgdir)"' $(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
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/DarkSquare.svg         svg/LightSquare.svg svg/NeutralSquare.svg \
107            svg/BlackAdvisor.svg       svg/WhiteAdvisor.svg    \
108            svg/BlackArchbishop.svg    svg/WhiteArchbishop.svg  \
109            svg/BlackBishop.svg        svg/WhiteBishop.svg      \
110            svg/BlackCanon.svg         svg/WhiteCanon.svg       \
111            svg/BlackChancellor.svg    svg/WhiteChancellor.svg  \
112            svg/BlackCobra.svg         svg/WhiteCobra.svg       \
113            svg/BlackCommoner.svg      svg/WhiteCommoner.svg    \
114            svg/BlackCrownedBishop.svg svg/WhiteCrownedBishop.svg  \
115            svg/BlackCrownedRook.svg   svg/WhiteCrownedRook.svg \
116            svg/BlackElephant.svg      svg/WhiteElephant.svg    \
117            svg/BlackGoldKnight.svg    svg/WhiteGoldKnight.svg  \
118            svg/BlackGoldLance.svg   svg/WhiteGoldLance.svg    \
119            svg/BlackGoldPawn.svg    svg/WhiteGoldPawn.svg     \
120            svg/BlackGoldSilver.svg  svg/WhiteGoldSilver.svg   \
121            svg/BlackGold.svg        svg/WhiteGold.svg         \
122            svg/BlackHawk.svg        svg/WhiteHawk.svg         \
123            svg/BlackKing.svg        svg/WhiteKing.svg         \
124            svg/BlackKnight.svg      svg/WhiteKnight.svg       \
125            svg/BlackLance.svg       svg/WhiteLance.svg        \
126            svg/BlackMarshall.svg    svg/WhiteMarshall.svg     \
127            svg/BlackNightrider.svg  svg/WhiteNightrider.svg   \
128            svg/BlackPawn.svg        svg/WhitePawn.svg         \
129            svg/BlackPrincess.svg    svg/WhitePrincess.svg     \
130            svg/BlackQueen.svg       svg/WhiteQueen.svg        \
131            svg/BlackRook.svg        svg/WhiteRook.svg         \
132            svg/BlackUnicorn.svg     svg/WhiteUnicorn.svg      \
133            svg/eo_Analyzing.svg     svg/eo_Black.svg          \
134            svg/eo_Clear.svg         svg/eo_Ponder.svg         \
135            svg/eo_Thinking.svg      svg/eo_Unknown.svg        \
136            svg/eo_White.svg
137
138 shogidir = $(datadir)/games/xboard/themes/shogi
139 dist_shogi_DATA = shogi/WhiteGold.svg shogi/WhiteCrownedBishop.svg\
140            shogi/WhiteBishop.svg      shogi/WhiteKing.svg\
141            shogi/WhiteKnight.svg      shogi/WhiteGoldKnight.svg\
142            shogi/WhiteLance.svg       shogi/WhiteGoldLance.svg\
143            shogi/WhitePawn.svg        shogi/WhiteGoldPawn.svg\
144            shogi/WhiteRook.svg        shogi/WhiteCrownedRook.svg\
145            shogi/WhiteAdvisor.svg     shogi/WhiteGoldSilver.svg
146
147 ### directory and files for pixmaps
148
149 pixmapsdir = $(datadir)/games/xboard/pixmaps/textures
150 dist_pixmaps_DATA = pixmaps/cross32.xpm pixmaps/cross48.xpm pixmaps/board32.xpm pixmaps/board48.xpm
151
152 ### directory and files for pngs
153
154 pngdir = $(datadir)/games/xboard/themes/textures
155 dist_png_DATA = png/hatch.png png/wood_d.png png/wood_l.png png/xqboard.png
156
157 ### directory and files for sound files
158
159 soundsdir = $(datadir)/games/xboard/sounds
160 dist_sounds_DATA = \
161   sounds/cymbal.wav     sounds/pop2.wav   sounds/slap.wav     sounds/ding1.wav      sounds/laser.wav \
162   sounds/woodthunk.wav  sounds/gong.wav   sounds/penalty.wav  sounds/honkhonk.wav   sounds/phone.wav
163
164
165 ### set correct dir in xboard.conf
166
167 edit = sed -e 's|@pngdir[@]|$(pngdir)|g' \
168            -e 's|@soundsdir[@]|$(soundsdir)|g'
169
170 xboard.conf: Makefile $(srcdir)/xboard.conf.in
171         @echo '  'GEN '  ' $@;
172         @rm -f $@ $@.tmp
173         @$(edit) $(srcdir)/$@.in >$@.tmp
174         @mv $@.tmp $@
175
176 distclean-local:
177         -rm -f xboard.conf
178
179 ### the man page depends on several files, so we add a special rule
180
181 xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi
182         $(srcdir)/texi2man $(srcdir)/xboard.texi > xboard.man || (rm -f xboard.man ; false)
183
184 ### install mime-type files and corresponding icons and menu entries if enabled during configure
185
186 install-data-hook: install-mime-database
187 uninstall-hook: uninstall-mime-database
188
189 install-mime-database:
190 if ENABLE_UPDATE_MIMEDB
191         -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \
192                 $(XDG_MIME) install --mode system --novendor xboard.xml ;\
193                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-pgn-viewer.desktop;\
194                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-fen-viewer.desktop;\
195                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-tourney.desktop;\
196                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-config.desktop;\
197                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/board32.xpm application-x-chess-pgn;\
198                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/cross32.xpm application-x-xboard-trn;\
199                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/ini32.xpm application-x-xboard-opt;\
200                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/board48.xpm application-x-chess-pgn;\
201                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/cross48.xpm application-x-xboard-trn;\
202                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/ini48.xpm application-x-xboard-opt;\
203         fi
204 endif
205
206 uninstall-mime-database:
207 if ENABLE_UPDATE_MIMEDB
208         -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \
209                 $(XDG_MIME) uninstall --mode system --novendor xboard.xml;\
210                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-pgn-viewer.desktop;\
211                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-fen-viewer.desktop;\
212                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-tourney.desktop;\
213                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-config.desktop;\
214                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 board32.xpm application-x-chess-pgn;\
215                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 cross32.xpm application-x-xboard-trn;\
216                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 ini32.xpm application-x-xboard-opt;\
217                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 board48.xpm application-x-chess-pgn;\
218                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 cross48.xpm application-x-xboard-trn;\
219                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 ini48.xpm application-x-xboard-opt;\
220         fi
221 endif