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

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

Rebuild now possible under Windows.

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