From 161d758ec06d54fafae31654e42823586eb724fe Mon Sep 17 00:00:00 2001 From: Bernard Davison Date: Sun, 19 Jun 2011 23:05:00 +1000 Subject: [PATCH] Getting google maps version dynamically and writing it to conf/maps_data/version --- .gitignore | 1 + Makefile | 6 ++++-- data/maps/Makefile | 13 +++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 data/maps/Makefile diff --git a/.gitignore b/.gitignore index 8864c07043..74824166ba 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ /conf/control_panel.xml /conf/%gconf.xml /conf/srtm_data/* +/conf/maps_data/* # /doc/pprz_algebra/ /doc/pprz_algebra/headfile.log diff --git a/Makefile b/Makefile index 5e928b0fa7..7a2c6dde55 100644 --- a/Makefile +++ b/Makefile @@ -227,7 +227,7 @@ cleanspaces: distclean : dist_clean dist_clean : clean rm -r conf/srtm_data - + rm -r conf/maps_data ab_clean: find sw/airborne -name '*~' -exec rm -f {} \; @@ -248,8 +248,10 @@ sw/simulator/launchsitl: cat src/$(@F) | sed s#OCAMLRUN#$(OCAMLRUN)# | sed s#OCAML#$(OCAML)# > $@ chmod a+x $@ -#.SUFFIXES: .hgt.zip +#.SUFFIXES: .hgt.zip .jpg %.hgt.zip: cd data/srtm; $(MAKE) $(@) +%.jpg: + cd data/maps; $(MAKE) $(@) diff --git a/data/maps/Makefile b/data/maps/Makefile new file mode 100644 index 0000000000..3e5fecf937 --- /dev/null +++ b/data/maps/Makefile @@ -0,0 +1,13 @@ +DATADIR = $(PAPARAZZI_HOME)/conf/maps_data +Q=@ + +all: $(DATADIR)/index $(DATADIR)/version + +$(DATADIR): + mkdir $(DATADIR) + +$(DATADIR)/index: $(DATADIR) + $(@)wget -O $(@) http://maps.google.com/ + +$(DATADIR)/version: $(DATADIR)/index + $(Q)grep -P "http://khm[0-9]+.google.com/kh/v=[0-9]+.x26" $(DATADIR)/index | sed -E s#.*http://khm[0-9]+.google.com/kh/v=## | sed -E s#.x26.*## > $(@)