Adapt fmax.ini file to Pair-o-Max
[fairymax.git] / Makefile
1 srcdir = .
2
3 CC?=gcc
4 CFLAGS?= -O2 -s
5 INI_F?=$(DESTDIR)/usr/share/games/fairymax/fmax.ini
6 INI_Q?=$(DESTDIR)/usr/share/games/fairymax/qmax.ini
7
8
9 ALL= fairymax shamax maxqi fairymax.6.gz
10
11 all: ${ALL}
12
13 fairymax: fairymax.c
14         $(CC) $(CFLAGS) -DINI_FILE=\"${INI_F}\" fairymax.c -o fairymax
15
16 shamax: fairymax.c
17         $(CC) $(CFLAGS) -DINI_FILE=\"${INI_F}\" -DSHATRANJ fairymax.c -o shamax
18
19 maxqi: maxqi.c
20         $(CC) $(CFLAGS) -DINI_FILE=\"${INI_Q}\" maxqi.c -o maxqi
21
22 install: ${ALL} ${srcdir}/data/*
23         cp -u ${srcdir}/fairymax $(DESTDIR)/usr/games
24         cp -u ${srcdir}/shamax $(DESTDIR)/usr/games
25         cp -u ${srcdir}/maxqi $(DESTDIR)/usr/games
26         install -d -m0755 $(DESTDIR)/usr/share/games/fairymax
27         cp -u ${srcdir}/data/* $(DESTDIR)/usr/share/games/fairymax
28         install -d -m0755 $(DESTDIR)/usr/share/man/man6
29         cp -u ${srcdir}/fairymax.6.gz $(DESTDIR)/usr/share/man/man6
30
31 fairymax.6.gz: fairymax.pod
32         pod2man -s 6 fairymax.pod > fmax.man
33         cp fmax.man fairymax.6
34         rm -f fairymax.6.gz
35         gzip fairymax.6
36
37 clean:
38         rm -f ${ALL}
39
40 dist-clean:
41         rm -f ${ALL} *~ data/*~ *.man md5sums
42
43 dist:
44         install -d -m0755 Fairy-Max
45         install -d -m0755 Fairy-Max/data
46         rm -f fairymax.tar fairymax.tar.gz
47         cp fairymax.c maxqi.c fairymax.pod Makefile README changelog copyright Fairy-Max
48         cp data/* Fairy-Max/data
49         (md5sum Fairy-Max/* Fairy-Max/data/* > Fairy-Max/md5sums) || true
50         tar -cvvf fairymax.tar Fairy-Max
51         gzip fairymax.tar
52         rm Fairy-Max/data/*
53         rmdir Fairy-Max/data
54         rm Fairy-Max/*
55         rmdir Fairy-Max
56
57 uninstall:
58         rm -f $(DESTDIR)/usr/share/games/fairymax/*
59         rmdir $(DESTDIR)/usr/share/games/fairymax
60         rm -f $(DESTDIR)/usr/share/man/man6/fairymax.6.gz
61         rm -f $(DESTDIR)/usr/games/fairymax
62         rm -f $(DESTDIR)/usr/games/shamax
63         rm -f $(DESTDIR)/usr/games/maxqi
64