b6a709b0a08f463a7a437ee289f01f039378808d
[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 shogi png sounds winboard \
63         xboard.texi gpl.texinfo texi2man texinfo.tex xboard.man xboard.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 AM_CPPFLAGS=-DINFODIR='"$(infodir)"' @X_CFLAGS@ @CAIRO_CFLAGS@ @FRONTEND_CFLAGS@  -DSYSCONFDIR='"$(sysconfdir)"' \
71             -DLOCALEDIR='"$(localedir)"' -DSVGDIR='"$(svgdir)"' $(headers)
72
73 ACLOCAL_AMFLAGS = -I m4
74
75 info_TEXINFOS =  xboard.texi
76 xboard_TEXINFOS =  copyright.texi
77 man6_MANS = xboard.man
78
79
80 ### config file
81
82 sysconf_DATA = xboard.conf
83
84 ### icon files
85
86 icondir = $(datadir)/icons/hicolor/48x48/apps
87 dist_icon_DATA = xboard.png
88 svgicondir = $(datadir)/icons/hicolor/scalable/apps
89 dist_svgicon_DATA = xboard.svg
90
91
92 ### desktop files for KDE and gnome
93
94 Applicationsdir = $(datadir)/applications
95 Applications_DATA = xboard.desktop xboard-fen-viewer.desktop  xboard-pgn-viewer.desktop  xboard-tourney.desktop
96
97 ### mime file
98 mimedir = $(datadir)/mime/packages
99 mime_DATA = xboard.xml
100
101 ### directory and files for svgs
102
103 svgdir = $(datadir)/games/xboard/themes/default
104 dist_svg_DATA = svg/icon_white.svg         svg/icon_black.svg      \
105            svg/DarkSquare.svg         svg/LightSquare.svg svg/NeutralSquare.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 = shogi/WhiteGold.svg shogi/WhiteCrownedBishop.svg\
139            shogi/WhiteBishop.svg      shogi/WhiteKing.svg\
140            shogi/WhiteKnight.svg      shogi/WhiteGoldKnight.svg\
141            shogi/WhiteLance.svg       shogi/WhiteGoldLance.svg\
142            shogi/WhitePawn.svg        shogi/WhiteGoldPawn.svg\
143            shogi/WhiteRook.svg        shogi/WhiteCrownedRook.svg\
144            shogi/WhiteAdvisor.svg     shogi/WhiteGoldSilver.svg
145
146 ### directory and files for pixmaps
147
148 pixmapsdir = $(datadir)/games/xboard/pixmaps/textures
149 dist_pixmaps_DATA = pixmaps/cross32.xpm pixmaps/cross48.xpm pixmaps/board32.xpm pixmaps/board48.xpm
150
151 ### directory and files for pngs
152
153 pngdir = $(datadir)/games/xboard/themes/textures
154 dist_png_DATA = png/hatch.png png/wood_d.png png/wood_l.png png/xqboard.png
155
156 ### directory and files for sound files
157
158 soundsdir = $(datadir)/games/xboard/sounds
159 dist_sounds_DATA = \
160   sounds/cymbal.wav     sounds/pop2.wav   sounds/slap.wav     sounds/ding1.wav      sounds/laser.wav \
161   sounds/woodthunk.wav  sounds/gong.wav   sounds/penalty.wav  sounds/honkhonk.wav   sounds/phone.wav
162
163
164 ### set correct dir in xboard.conf
165
166 edit = sed -e 's|@pngdir[@]|$(pngdir)|g' \
167            -e 's|@soundsdir[@]|$(soundsdir)|g'
168
169 xboard.conf: Makefile $(srcdir)/xboard.conf.in
170         @echo '  'GEN '  ' $@;
171         @rm -f $@ $@.tmp
172         @$(edit) $(srcdir)/$@.in >$@.tmp
173         @mv $@.tmp $@
174
175 distclean-local:
176         -rm -f xboard.conf
177
178 ### the man page depends on several files, so we add a special rule
179
180 xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi
181         $(srcdir)/texi2man $(srcdir)/xboard.texi > xboard.man || (rm -f xboard.man ; false)
182
183 ### install mime-type files and corresponding icons and menu entries if enabled during configure
184
185 install-data-hook: install-mime-database
186 uninstall-hook: uninstall-mime-database
187
188 install-mime-database:
189 if ENABLE_UPDATE_MIMEDB
190         -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \
191                 $(XDG_MIME) install --mode system --novendor xboard.xml ;\
192                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-pgn-viewer.desktop;\
193                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-fen-viewer.desktop;\
194                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-tourney.desktop;\
195                 $(XDG_DESKTOP_MENU) install --mode system --novendor xboard-config.desktop;\
196                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/board32.xpm application-x-chess-pgn;\
197                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/cross32.xpm application-x-xboard-trn;\
198                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 32 pixmaps/ini32.xpm application-x-xboard-opt;\
199                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/board48.xpm application-x-chess-pgn;\
200                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/cross48.xpm application-x-xboard-trn;\
201                 $(XDG_ICON_RESOURCE) install --context mimetypes --size 48 pixmaps/ini48.xpm application-x-xboard-opt;\
202         fi
203 endif
204
205 uninstall-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) uninstall --mode system --novendor xboard.xml;\
209                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-pgn-viewer.desktop;\
210                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-fen-viewer.desktop;\
211                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-tourney.desktop;\
212                 $(XDG_DESKTOP_MENU) uninstall --mode system --novendor xboard-config.desktop;\
213                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 board32.xpm application-x-chess-pgn;\
214                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 cross32.xpm application-x-xboard-trn;\
215                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 32 ini32.xpm application-x-xboard-opt;\
216                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 board48.xpm application-x-chess-pgn;\
217                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 cross48.xpm application-x-xboard-trn;\
218                 $(XDG_ICON_RESOURCE) uninstall --context mimetypes --size 48 ini48.xpm application-x-xboard-opt;\
219         fi
220 endif