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

Last change on this file since 29350 was 27325, checked in by nic, 8 years ago

Fix link errors with gcc-4.6 / Ubuntu-11.10.
Fix HEADLESS compile
Provide for larger planet

File size: 7.3 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
54gosmore:        jni/gosmore.cpp jni/libgosm.cpp jni/libgosm.h jni/bboxes.c \
55                jni/openglespolygon.h jni/openglespolygon.cpp
56                g++ -DCHILDREN=16 ${CFLAGS} ${WARNFLAGS} \
57                  jni/gosmore.cpp jni/libgosm.cpp jni/openglespolygon.h \
58                  jni/openglespolygon.cpp -o gosmore ${EXTRA} ${XMLFLAGS}
59
60gosmore16:      jni/gosmore.cpp jni/libgosm.cpp jni/libgosm.h
61                g++ -DGOSMZ=16 ${CFLAGS} ${WARNFLAGS} ${XMLFLAGS} \
62                  jni/gosmore.cpp jni/libgosm.cpp -o gosmore16 ${EXTRA}
63
64$(ARCH)gosmore.exe:     jni/gosmore.cpp jni/libgosm.cpp gosmore.rsc jni/resource.h \
65                    jni/libgosm.h jni/ceglue.h jni/ceglue.c bboxes.c
66                ${ARCH}g++ ${CFLAGS} ${EXTRAC} -c jni/gosmore.cpp
67                ${ARCH}g++ ${CFLAGS} ${EXTRAC} -c jni/libgosm.cpp
68                ${ARCH}gcc ${CFLAGS} ${EXTRAC} -c jni/ConvertUTF.c
69                ${ARCH}gcc ${CFLAGS} ${EXTRAC} -c jni/ceglue.c
70                ${ARCH}g++ -static ${EXTRAL} \
71                  gosmore.o libgosm.o ceglue.o ConvertUTF.o gosmore.rsc $(W32LIBS)  -o $@
72
73tagcmp.o:       tagcmp.l
74
75gosmore.rsc:    gosmore.rc icons.bmp icons-mask.bmp gosmore.ico
76                $(WINDRES) $< $@
77
78WIKIPAGE=http://wiki.openstreetmap.org/index.php/Special:Export/Gosmore
79translations.c: extract
80                wget -O - ${WIKIPAGE}/Translations |./extract >jni/translations.c
81
82extract:        extract.c
83                ${CC} ${CFLAGS} ${XMLFLAGS} extract.c -o extract
84
85jni/bboxes.c:   density.c density.txt
86                gcc density.c -lm -o density
87                ./density <density.txt >density.sh
88# wget http://www.openstreetmap.org/api/0.6/changeset/1707270/download -O \
89#   countries.osm
90
91osmunda:        osmunda.cpp jni/libgosm.cpp jni/libgosm.h
92                g++ ${CFLAGS} ${WARNFLAGS} ${XMLFLAGS} \
93                  osmunda.cpp jni/libgosm.cpp -o osmunda
94voices:
95                echo '(voice_rab_diphone)' >/tmp/voice_rab_diphone
96                echo 'At the junction, turn left.' | festival_client \
97                  --prolog /tmp/voice_rab_diphone --output turnleft.wav --ttw
98                echo 'At the junction, turn right.' | festival_client \
99                  --prolog /tmp/voice_rab_diphone --output turnright.wav --ttw
100                echo 'Keep left.' | festival_client \
101                  --prolog /tmp/voice_rab_diphone --output keepleft.wav --ttw
102                echo 'Keep right.' | festival_client \
103                  --prolog /tmp/voice_rab_diphone --output keepright.wav --ttw
104                echo 'If possible make a U turn.' | festival_client \
105                  --prolog /tmp/voice_rab_diphone --output uturn.wav --ttw
106                echo 'You have reached your destination.' | festival_client \
107                  --prolog /tmp/voice_rab_diphone --output stop.wav --ttw
108                echo 'At the roundabout take the first exit.' | \
109  festival_client --prolog /tmp/voice_rab_diphone --output round1.wav --ttw
110                echo 'At the roundabout take the second exit.' | \
111  festival_client --prolog /tmp/voice_rab_diphone --output round2.wav --ttw
112                echo 'At the roundabout take the third exit.' | \
113  festival_client --prolog /tmp/voice_rab_diphone --output round3.wav --ttw
114                echo 'At the roundabout take the fourth exit.' | \
115  festival_client --prolog /tmp/voice_rab_diphone --output round4.wav --ttw
116                echo 'At the roundabout take the fifth exit.' | \
117  festival_client --prolog /tmp/voice_rab_diphone --output round5.wav --ttw
118                echo 'At the roundabout take the sixth exit.' | \
119  festival_client --prolog /tmp/voice_rab_diphone --output round6.wav --ttw
120                echo 'At the roundabout take the seventh exit.' | \
121  festival_client --prolog /tmp/voice_rab_diphone --output round7.wav --ttw
122                echo 'At the roundabout take the eight exit.' | \
123  festival_client --prolog /tmp/voice_rab_diphone --output round8.wav --ttw
124
125#elemstyles.xml:
126#               wget http://josm.openstreetmap.de/svn/trunk/styles/standard/elemstyles.xml
127
128zip:
129        (cd /msys; zip - etc/gtk-2.0/* lib/gtk-2.0/2.10.0/loaders/*) >gosmore.zip
130        zip -j gosmore.zip gosmore.exe icons.xpm /msys/bin/libcairo-2.dll \
131        /msys/bin/lib*.dll /msys/bin/intl*.dll /msys/bin/zlib*.dll
132        zip -j gosm_arm.zip ARMV4Rel/gosm_arm.exe *.wav
133        # scp -P 100 gosm_arm.zip gosmore.zip \
134        #  nroets@nroets.openhost.dk:nroets.openhost.dk/htdocs/
135
136install: gosmore default.pak
137        mkdir -p $(DESTDIR)$(bindir)
138        cp gosmore $(DESTDIR)$(bindir)/.
139        mkdir -p $(DESTDIR)$(datarootdir)/gosmore
140        cp -a *.wav default.pak elemstyles.xml icons.csv icons.xpm \
141          $(DESTDIR)$(datarootdir)/gosmore
142        mkdir -p $(DESTDIR)$(datarootdir)/man/man1
143        gzip <gosmore.1 >$(DESTDIR)$(datarootdir)/man/man1/gosmore.1.gz
144        mkdir -p $(DESTDIR)$(datarootdir)/pixmaps
145        cp -a gosmore.xpm $(DESTDIR)$(datarootdir)/pixmaps
146        mkdir -p $(DESTDIR)$(datarootdir)/applications
147        cp -a gosmore.desktop $(DESTDIR)$(datarootdir)/applications
148
149# The commands below will create a gpx file with a low res version of the national boundaries
150# Then you must open tmp.gpx in JOSM and save it as bounds.osm. Then this makefile will
151# use sed to reencode the ids to the 2 billion range and use grep to concatenate it with
152# the geonames cities and the osm country names.
153#
154# sudo apt-get install libshp-dev
155# wget http://www.obviously.com/gis/shp2text/shp2text.c
156# gcc -lshp shp2text.c -o shp2text
157# wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/110m-admin-0-countries.zip
158# unzip 110m-admin-0-countries.zip
159# ./shp2text --gpx 110m-admin-0-countries.shp 0 4 |
160#   gpsbabel -r -i gpx -f - -x transform,trk=rte,del -o gpx -F tmp.gpx
161 
162default.pak: gosmore
163        ! [ -e gosmore.pak ]
164        (bzgrep -v '</osm>' bounds.osm.bz2 | sed -e 's/'\''-\([0-9]*'\''\)/'\''00000000\1/' |\
165          sed -e 's/0*\([0-9]\{8\}'\''\)/21\1/'; \
166         bzcat lowres.osm.bz2; \
167         egrep -v '?xml|<osmCha' countries.osm | sed -e 's|/osmChange|/osm|') | \
168             QUERY_STRING=suppressGTK ./gosmore rebuild
169        mv gosmore.pak default.pak
170
171routingTest: gosmore
172        ! [ -e gosmore.pak ]
173        sed -e 's/\(nd='\''\|ref='\''\|id='\''\)-\([0-9]*'\''\)/\121000\2/' routingTest.osm |\
174          ./gosmore rebuild
175
176dist:
177        mkdir gosmore-$(VERSION)
178        cp jni/gosmore.cpp Makefile elemstyles.xml icons.csv icons.xpm  README \
179          gosmore-$(VERSION)
180        tar zcf gosmore-$(VERSION).tar.gz gosmore-$(VERSION)
181        rm -rf gosmore-$(VERSION)
182
183clean:
184        $(RM) gosmore *.tmp *~ gosmore.zip $(ARCH)gosmore.exe gosmore.rsc \
185          gosmore.aps gosmore.vcl gosmore.vcw extract *.o
Note: See TracBrowser for help on using the repository browser.