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