source: subversion/applications/rendering/gosmore/Makefile.in @ 21339

Last change on this file since 21339 was 21339, checked in by nic, 9 years ago

Simplify Debian package build, by using autoconf.
Add coastlines to default.pak
Suppress a few more tags.

File size: 7.6 KB
Line 
1# Written by Nic Roets with contributions by Petter Reinholdtsen
2# Placed in the public domain
3
4TODAY := `exec date +%Y%m%d`
5VERSION = 0.0.0.$(TODAY)
6
7DESTDIR=
8prefix = @prefix@
9bindir = $(prefix)/bin
10datarootdir = $(prefix)/share
11
12CFLAGS=-O2 -DRES_DIR=\"$(prefix)/share/gosmore/\"
13WARNFLAGS= -W -Wall
14
15#"------------------------ Compiling with cegcc : ---------------------------
16# tar xzf -C / cygwin-cegcc-mingw32ce-0.51.0-1.tar.gz
17# export PATH="$PATH":/opt/mingw32ce/bin/
18
19WINDRES=        ${ARCH}windres
20
21# enable this to test the experimental route support
22#CFLAGS += -DROUTE_TEST
23
24# enable this to force gosmore into headless mode (gosmore will also
25# be put in headless mode if gtk+-2.0 isn't available)
26#CFLAGS += -DHEADLESS
27
28ifneq (${OS},Windows_NT)
29EXTRA=`pkg-config --cflags --libs gtk+-2.0 || echo -D HEADLESS` \
30  `pkg-config --libs libcurl` `pkg-config --libs pkg-config --libs gthread-2.0`
31
32# I found that it's more reliable and more portable to use aplay, but
33# gnome sound can still be activated with this:
34#  `pkg-config --cflags --libs libgnomeui-2.0 && echo -DUSE_GNOMESOUND`
35XMLFLAGS=`pkg-config --cflags libxml-2.0 || echo -I /usr/include/libxml2` \
36  `pkg-config --libs libxml-2.0 || echo -l xml2 -lz -lm`
37ARCH=arm-mingw32ce-
38else
39# To compile with mingw, install MSYS and mingw, and then download
40# the "all-in-one bundle" from http://www.gtk.org/download-windows.html
41# and unzip it to C:\msys\1.0.
42EXTRAC=-mms-bitfields -mno-cygwin -mwindows \
43  `pkg-config --cflags gtk+-2.0 || echo -D NOGTK`
44EXTRAL=`pkg-config --libs gtk+-2.0`
45EXE=.exe
46W32LIBS=-lwsock32 -lwinmm
47endif
48
49all: gosmore$(EXE)
50
51# The planet is too big to fit into the address space of a single process on
52# a 32 bit CPUs. So we break it up into pieces (overlapping rectangles and
53# some lowzoom extracts) and then run one process for each piece. The parent
54# task then chooses the most
55# appropriate process and forwards the expose, search or routing request to
56# it. THE CODE IS NOT FINISHED. Linux version looks promising.
57gosmore:        gosmore.cpp libgosm.cpp libgosm.h bboxes.c
58                g++ -DCHILDREN=16 ${CFLAGS} ${WARNFLAGS} ${XMLFLAGS} \
59                  gosmore.cpp libgosm.cpp -o gosmore ${EXTRA}
60
61gosmore16:      gosmore.cpp libgosm.cpp libgosm.h
62                g++ -DGOSMZ=16 ${CFLAGS} ${WARNFLAGS} ${XMLFLAGS} \
63                  gosmore.cpp libgosm.cpp -o gosmore16 ${EXTRA}
64
65$(ARCH)gosmore.exe:     gosmore.cpp libgosm.cpp gosmore.rsc resource.h \
66                    libgosm.h ceglue.h ceglue.c bboxes.c
67                ${ARCH}g++ ${CFLAGS} ${EXTRAC} -c gosmore.cpp
68                ${ARCH}g++ ${CFLAGS} ${EXTRAC} -c libgosm.cpp
69                ${ARCH}gcc ${CFLAGS} ${EXTRAC} -c ConvertUTF.c
70                ${ARCH}gcc ${CFLAGS} ${EXTRAC} -c ceglue.c
71                ${ARCH}g++ -static ${CFLAGS} ${EXTRAC} -o $@ \
72                  gosmore.o libgosm.o ceglue.o ConvertUTF.o gosmore.rsc $(W32LIBS)
73
74gosmore.rsc:    gosmore.rc icons.bmp icons-mask.bmp gosmore.ico
75                $(WINDRES) $< $@
76
77WIKIPAGE=http://wiki.openstreetmap.org/index.php/Special:Export/Gosmore
78translations.c: extract
79                wget -O - ${WIKIPAGE}/Translations |./extract >translations.c
80
81extract:        extract.c
82                ${CC} ${CFLAGS} ${XMLFLAGS} extract.c -o extract
83
84bboxes.c:       density.c density.txt
85                gcc -lm density.c -o density
86                ./density <density.txt >density.sh
87# wget http://www.openstreetmap.org/api/0.6/changeset/1707270/download -O \
88#   countries.osm
89
90osmunda:        osmunda.cpp libgosm.cpp libgosm.h
91                g++ ${CFLAGS} ${WARNFLAGS} ${XMLFLAGS} \
92                  osmunda.cpp libgosm.cpp -o osmunda
93voices:
94                echo '(voice_rab_diphone)' >/tmp/voice_rab_diphone
95                echo 'At the junction, turn left.' | festival_client \
96                  --prolog /tmp/voice_rab_diphone --output turnleft.wav --ttw
97                echo 'At the junction, turn right.' | festival_client \
98                  --prolog /tmp/voice_rab_diphone --output turnright.wav --ttw
99                echo 'Keep left.' | festival_client \
100                  --prolog /tmp/voice_rab_diphone --output keepleft.wav --ttw
101                echo 'Keep right.' | festival_client \
102                  --prolog /tmp/voice_rab_diphone --output keepright.wav --ttw
103                echo 'If possible make a U turn.' | festival_client \
104                  --prolog /tmp/voice_rab_diphone --output uturn.wav --ttw
105                echo 'You have reached your destination.' | festival_client \
106                  --prolog /tmp/voice_rab_diphone --output stop.wav --ttw
107                echo 'At the roundabout take the first exit.' | \
108  festival_client --prolog /tmp/voice_rab_diphone --output round1.wav --ttw
109                echo 'At the roundabout take the second exit.' | \
110  festival_client --prolog /tmp/voice_rab_diphone --output round2.wav --ttw
111                echo 'At the roundabout take the third exit.' | \
112  festival_client --prolog /tmp/voice_rab_diphone --output round3.wav --ttw
113                echo 'At the roundabout take the fourth exit.' | \
114  festival_client --prolog /tmp/voice_rab_diphone --output round4.wav --ttw
115                echo 'At the roundabout take the fifth exit.' | \
116  festival_client --prolog /tmp/voice_rab_diphone --output round5.wav --ttw
117                echo 'At the roundabout take the sixth exit.' | \
118  festival_client --prolog /tmp/voice_rab_diphone --output round6.wav --ttw
119                echo 'At the roundabout take the seventh exit.' | \
120  festival_client --prolog /tmp/voice_rab_diphone --output round7.wav --ttw
121                echo 'At the roundabout take the eight exit.' | \
122  festival_client --prolog /tmp/voice_rab_diphone --output round8.wav --ttw
123
124#elemstyles.xml:
125#               wget http://josm.openstreetmap.de/svn/trunk/styles/standard/elemstyles.xml
126
127zip:
128        (cd /msys; zip - etc/gtk-2.0/* lib/gtk-2.0/2.10.0/loaders/*) >gosmore.zip
129        zip -j gosmore.zip gosmore.exe icons.xpm /msys/bin/libcairo-2.dll \
130        /msys/bin/lib*.dll /msys/bin/intl*.dll /msys/bin/zlib*.dll
131        zip -j gosm_arm.zip ARMV4Rel/gosm_arm.exe *.wav
132        # scp -P 100 gosm_arm.zip gosmore.zip \
133        #  nroets@nroets.openhost.dk:nroets.openhost.dk/htdocs/
134
135install: gosmore default.pak
136        mkdir -p $(DESTDIR)$(bindir)
137        cp gosmore $(DESTDIR)$(bindir)/.
138        mkdir -p $(DESTDIR)$(datarootdir)/gosmore
139        cp -a *.wav default.pak elemstyles.xml icons.csv icons.xpm \
140          $(DESTDIR)$(datarootdir)/gosmore
141        mkdir -p $(DESTDIR)$(datarootdir)/man/man1
142        gzip <gosmore.1 >$(DESTDIR)$(datarootdir)/man/man1/gosmore.1.gz
143        mkdir -p $(DESTDIR)$(datarootdir)/pixmaps
144        cp -a gosmore.xpm $(DESTDIR)$(datarootdir)/pixmaps
145        mkdir -p $(DESTDIR)$(datarootdir)/applications
146        cp -a gosmore.desktop $(DESTDIR)$(datarootdir)/applications
147
148# The commands below will create a gpx file with a low res version of the national boundaries
149# Then you must open tmp.gpx in JOSM and save it as bounds.osm. Then this makefile will
150# use sed to reencode the ids to the 2 billion range and use grep to concatenate it with
151# the geonames cities and the osm country names.
152#
153# sudo apt-get install libshp-dev
154# wget http://www.obviously.com/gis/shp2text/shp2text.c
155# gcc -lshp shp2text.c -o shp2text
156# wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/110m-admin-0-countries.zip
157# unzip 110m-admin-0-countries.zip
158# ./shp2text --gpx 110m-admin-0-countries.shp 0 4 |
159#   gpsbabel -r -i gpx -f - -x transform,trk=rte,del -o gpx -F tmp.gpx
160 
161default.pak: gosmore
162        ! [ -e gosmore.pak ]
163        (bzgrep -v '</osm>' bounds.osm.bz2 | sed -e 's/'\''-\([0-9]*'\''\)/'\''00000000\1/' |\
164          sed -e 's/0*\([0-9]\{8\}'\''\)/21\1/'; \
165         bzcat lowres.osm.bz2; \
166         egrep -v '?xml|<osmCha' countries.osm | sed -e 's|/osmChange|/osm|') | \
167             QUERY_STRING=suppressGTK ./gosmore rebuild
168        mv gosmore.pak default.pak
169
170routingTest: gosmore
171        ! [ -e gosmore.pak ]
172        sed -e 's/\(nd='\''\|ref='\''\|id='\''\)-\([0-9]*'\''\)/\121000\2/' routingTest.osm |\
173          ./gosmore rebuild
174
175dist:
176        mkdir gosmore-$(VERSION)
177        cp gosmore.cpp Makefile elemstyles.xml icons.csv icons.xpm  README \
178          gosmore-$(VERSION)
179        tar zcf gosmore-$(VERSION).tar.gz gosmore-$(VERSION)
180        rm -rf gosmore-$(VERSION)
181
182clean:
183        $(RM) gosmore *.tmp *~ gosmore.zip $(ARCH)gosmore.exe gosmore.rsc \
184          gosmore.aps gosmore.vcl gosmore.vcw extract *.o
Note: See TracBrowser for help on using the repository browser.