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

Last change on this file since 34655 was 29383, checked in by nic, 6 years ago

Allow bboxSplit to work with large node id.
Remove obsolete rule and variable from Makefile.

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