chiark / gitweb /
Bigger limit for specific-destination route searches
[ypp-sc-tools.db-test.git] / yarrg / Makefile
1 # This is part of ypp-sc-tools, a set of third-party tools for assisting
2 # players of Yohoho Puzzle Pirates.
3 #
4 # Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # The parts of the code used for the website (including the web/
12 # directory and the rs*.[ch] which make up the routesearch program)
13 # are released instead under the GNU Affero General Public License as
14 # published by the Free Software Foundation, either version 3 of the
15 # License, or (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
24 #
25 # Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
26 # are used without permission.  This program is not endorsed or
27 # sponsored by Three Rings.
28
29
30 CC= gcc
31 OPTIMISE= -O2
32 WERROR= -Werror
33 WARNINGS= -Wall -Wwrite-strings -Wpointer-arith -Wmissing-prototypes \
34           -Wstrict-prototypes -Wno-format-zero-length
35 DEBUG=-g
36
37 CFLAGS += $(WARNINGS) $(WERROR) $(OPTIMISE) $(DEBUG)
38
39 TARGETS_CLIENT= yarrg
40 TARGETS_SERVER= routesearch
41 TARGETS= $(TARGETS_CLIENT) $(TARGETS_SERVER)
42
43 default: clean-other-directory client
44 client: $(TARGETS_CLIENT)
45 server: $(TARGETS_SERVER)
46 all: client server
47
48 CONVERT_OBJS= convert.o ocr.o pages.o structure.o rgbimage.o resolve.o
49 COMMON_OBJS= common.o
50 ROUTESEARCH_OBJS= rsvalue.o rsmain.o rssql.o rssearch.o
51
52 yarrg:  $(CONVERT_OBJS) $(COMMON_OBJS) -lnetpbm -lXtst -lX11 -lpcre -lm
53         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
54
55 $(CONVERT_OBJS): common.h ocr.h convert.h structure.h
56
57 routesearch:    $(ROUTESEARCH_OBJS) $(COMMON_OBJS) -lsqlite3 -lglpk -lm
58         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
59
60 $(ROUTESEARCH_OBJS): common.h rscommon.h
61 $(COMMON_OBJS): common.h
62
63 clean:
64         rm -f *.o core core.* *~ vgcore.*
65         rm -f t t.* u u.* v v.* *.tmp *.orig *.rej
66         rm -f ypp-commodities
67
68 realclean: clean
69         rm -f $(TARGETS)
70         rm -f _pages.ppm _pages.ppm.gz _upload-*.html _commodmap.tsv
71         rm -f _master-*.txt _master-*.txt.gz _local-*.txt
72         rm -f ./#pages#.ppm ./#upload-*#.html ./#commodmap#.tsv
73         rm -f ./#master-*#.txt ./#local-*#.txt raw.tsv
74
75 clean-other-directory:
76         @set -e; if test -d ../pctb && ! test -L ../pctb; then \
77                 echo '*** tidying up ../pctb; moving local data here ***'; \
78                 set -x; \
79                 find ../pctb -path '../pctb/_local-*.txt' -exec mv '{}' . \;; \
80                 $(MAKE) -C ../pctb -f ../yarrg/Makefile realclean; \
81                 rmdir ../pctb; \
82         fi