File: makefile

package info (click to toggle)
phalanx 25-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,048 kB
  • sloc: ansic: 8,829; sh: 80; makefile: 79
file content (70 lines) | stat: -rw-r--r-- 2,243 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
####### default places (can be overridden by "make prefix=/usr install" etc.)

prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/games
libdir = $(prefix)/share/phalanx
pluginsdir = $(prefix)/share/games/plugins/xboard

####### choose the line that makes the binary faster on your machine
# CFLAGS = -O3 -Wall -fomit-frame-pointer -funroll-loops
#CFLAGS = -O3 -Wall --std=gnu89 -D_GNU_SOURCE
# CFLAGS = -fprofile-generate -mtune=native -O3 -Wall --std=gnu89 -D_GNU_SOURCE
# CFLAGS = -fprofile-use -mtune=native -O3 -Wall --std=gnu89 -D_GNU_SOURCE
# CFLAGS = -O3 -Wall -fomit-frame-pointer --std=gnu89 -D_GNU_SOURCE
# -std=c99
#-Werror removed

####### debug/tuning options for developers
# CFLAGS = -O -Wall -g3 -static
# CFLAGS = -O -Wall -pg

#######
### DEFINES
### -DSHOW_FORCED_MOVES
### -DPBOOK_FILE=\"pbook.phalanx\"
### -DSBOOK_FILE=\"sbook.phalanx\"
### -DLEARN_FILE=\"learn.phalanx\"
### -DPBOOK_DIR=\"${libdir}\"
### -DSBOOK_DIR=\"${libdir}\"
### -DLEARN_DIR=\"/var/local/lib\"
### -DQCAPSONLY

DEFINES = -DGNUFUN -DPBOOK_DIR=\"/usr/share/phalanx\" -DSBOOK_DIR=\"/usr/share/phalanx\" \
          -DLEARN_DIR=\"/var/games\" -DLEARN_FILE=\"phalanx.learn\"
#LDFLAGS =

OBJ = .o/phalanx.o .o/bcreate.o .o/search.o .o/io.o .o/data.o \
	   .o/evaluate.o .o/genmoves.o .o/moving.o .o/hash.o .o/static.o \
	   .o/levels.o .o/book.o .o/killers.o .o/endgame.o .o/learn.o .o/easy.o

phalanx: .o $(OBJ)
	$(CC) $(CFLAGS) $(DEFINES) $(OBJ) $(LDFLAGS) -o phalanx

.o/%.o: makefile phalanx.h %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c $*.c -o .o/$*.o

.o:
	mkdir .o

clean:
	rm -rf .o phalanx *.lrn learn.phalanx

backup:
	tar -czvf Archive/phalanx.tgz \
	makefile *.c *.h pbook.phalanx sbook.phalanx test.fin phalanx.eng

install: phalanx
	install -d 0755 $(DESTDIR)$(bindir)
	install -m 0755 phalanx $(DESTDIR)$(bindir)
	install -d 0755 $(DESTDIR)$(libdir)
	install -m 0644 pbook.phalanx $(DESTDIR)$(libdir)
	install -m 0644 sbook.phalanx $(DESTDIR)$(libdir)
	install -d 0755 $(DESTDIR)$(pluginsdir)
	install -m 0644 phalanx.eng $(DESTDIR)$(pluginsdir)

uninstall:
	rm -f $(DESTDIR)$(bindir)/phalanx
	rm -f $(DESTDIR)$(libdir)/pbook.phalanx
	rm -f $(DESTDIR)$(libdir)/sbook.phalanx
	rm -f $(DESTDIR)$(pluginsdir)/phalanx.eng