diff options
author | James Meyer <james.meyer@operamail.com> | 2009-07-04 23:05:09 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2009-07-04 23:05:09 (GMT) |
commit | 879da47e831fa0c5dc443f1059717af8184cb6d8 (patch) | |
tree | 08892860acda11a7594788c8687ec960dac4b68d /abs/core-testing/LinHES-timezone/Makefile | |
parent | 19e8f207678d02f9a912aa0728b90a4c63d82c82 (diff) | |
parent | 21f912004613ab41436b36b424f943f3c5bfbf83 (diff) | |
download | linhes_pkgbuild-879da47e831fa0c5dc443f1059717af8184cb6d8.zip linhes_pkgbuild-879da47e831fa0c5dc443f1059717af8184cb6d8.tar.gz linhes_pkgbuild-879da47e831fa0c5dc443f1059717af8184cb6d8.tar.bz2 |
Merge branch 'HEAD' of ssh://jams@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Conflicts:
abs/core-testing/LinHES-config/PKGBUILD
Diffstat (limited to 'abs/core-testing/LinHES-timezone/Makefile')
-rw-r--r-- | abs/core-testing/LinHES-timezone/Makefile | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/abs/core-testing/LinHES-timezone/Makefile b/abs/core-testing/LinHES-timezone/Makefile new file mode 100644 index 0000000..d543638 --- /dev/null +++ b/abs/core-testing/LinHES-timezone/Makefile @@ -0,0 +1,62 @@ +all: linhes_timezone + +clean: + rm -Rf tables maps \ + WorldTZ.mdb WorldTZ.mfd WorldTZ.mas WorldTZ.mws WorldTZ_readme.txt map_data.txt \ + extract_map_data create_map_include linhes_timezone timezone_map.h + +#WorldTZ.mdb WorldTZ.mfd : WorldTZ_102.zip +# unzip WorldTZ_102.zip ; touch WorldTZ.mdb WorldTZ.mfd + +tables/AttrDesc : WorldTZ.mdb + mkdir -p tables + for table in $$(mdb-tables WorldTZ.mdb) ; do mdb-export WorldTZ.mdb $$table > tables/$$table ; done + sed -i 's/ //g' tables/AttrDesc # Fix TZ corruption. + echo 1254 >> tables/11001 # Add Central African Republic to the UTC+1 borders. + grep -v ^7867$$ tables/11017 > tables/11017.tmp ; mv tables/11017.tmp tables/11017 # Remove WA from UTC+9 + grep -v ^7866$$ tables/11017 > tables/11017.tmp ; mv tables/11017.tmp tables/11017 # Remove WA/SA border from UTC+9 + echo 7867 >> tables/11016 # Put WA in UTC+8 + +map_data.txt : extract_map_data WorldTZ.mfd + ./extract_map_data > map_data.txt + +extract_map_data : extract_map_data.c + cc --std=c99 -o extract_map_data -lm extract_map_data.c + +maps : map_data.txt tables/AttrDesc + mkdir maps + for zone in $$(cat tables/AttrDesc | grep 110 | grep -v 11000 | grep -v 11020 | cut -d ',' -f 1) ; \ + do \ + offset=$$(grep $$zone tables/AttrDesc | cut -d '"' -f 2 | sed 's/+//g' ) ; \ + echo $$offset >> maps/zones ; \ + boundary=boundary$$offset; \ + echo $$boundary ; \ + for section in $$(cat tables/$$zone) ; do grep "^$$section," map_data.txt >> maps/$$boundary ; done ; \ + done ; \ + for i in `cat tables/U8000 | grep -v ObjID | cut -d '"' -f 2 ` ; do \ + echo i=$$i ; \ + zone=$$(grep "^\\\"$$i\\\"," tables/U8000 | cut -d '"' -f 4) ; \ + echo zone=$$zone ; \ + tz_name=$$(grep "^\\\"$$i\\\"," tables/U7000 | cut -d '"' -f 4) ; \ + echo tz_name=$$tz_name ; \ + tz_lat=$$(grep "^$$i," tables/U5000 | cut -d ',' -f 2) ; \ + echo tz_lat=$$tz_lat ; \ + tz_lon=$$(grep "^$$i," tables/U6000 | cut -d ',' -f 2) ; \ + echo tz_lon=$$tz_lon ; \ + echo $$tz_lat $$tz_lon $$tz_name >> maps/places$$zone ; \ + done ;\ + for places in maps/places* ; do \ + sort -g -r $$places > $$places.sorted ; mv $$places.sorted $$places ; \ + done ; \ + sort -g maps/zones > maps/zones.sorted + cat Tux.csv >> maps/boundary14 + +./create_map_include : create_map_include.c maps + cc -lm --std=gnu99 -o ./create_map_include create_map_include.c + +timezone_map.h : ./create_map_include + ./create_map_include > timezone_map.h + +linhes_timezone : linhes_timezone.c timezone_map.h + cc --std=gnu99 -O3 -pthread -lXt -llirc_client -lm -o linhes_timezone linhes_timezone.c + |