4
4
libgweatherlocationsdir = $(pkgdatadir)
5
5
libgweatherlocations_in_files = Locations.xml.in
11
libgweatherlocations_DATA = $(libgweatherlocations_in_files:.xml.in=.xml$(COMPRESS_EXT))
13
%.xml$(COMPRESS_EXT): %.xml.in $(wildcard $(top_srcdir)/po-locations/*.po)
14
$(AM_V_GEN)LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po-locations/.intltool-merge-cache $(top_srcdir)/po-locations $< `echo $@ | sed "s/.xml$(COMPRESS_EXT)/.xml/"` && \
15
if test "x$(COMPRESS_EXT)" = "x.gz"; then \
16
gzip --force `echo $@ | sed "s/.xml$(COMPRESS_EXT)/.xml/"`; \
19
else # USE_ONE_BIG_XML
21
7
LOCATIONS_STAMP = stamp-Locations.xml
23
PO_LOCATIONS = $(shell if test -n "$(LINGUAS)"; then for lang in $(LINGUAS); do if test -f "$(top_srcdir)/po-locations/$$lang.po"; then echo "$(top_srcdir)/po-locations/$$lang.po "; fi; done; else for pofile in $(top_srcdir)/po-locations/*.po; do echo $$pofile; done; fi)
26
libgweatherlocations_data = $(libgweatherlocations_in_files:.xml.in=.xml)
28
libgweatherlocations_DATA = $(shell echo $(PO_LOCATIONS) | sed "s|$(top_srcdir)/po-locations/|Locations.|g;s|\.po|.xml$(COMPRESS_EXT)|g") $(libgweatherlocations_data)$(COMPRESS_EXT)
10
libgweatherlocations_DATA = $(libgweatherlocations_in_files:.xml.in=.xml)
30
12
# We need this step so that we merge all the make Locations.xy.xml destinations
31
13
# into one unique destination. This makes -j2 work. (Else, we end up with
32
14
# multiple and conflicting calls to intltool-merge)
33
15
$(libgweatherlocations_DATA): $(LOCATIONS_STAMP)
35
$(LOCATIONS_STAMP): $(libgweatherlocations_in_files) $(PO_LOCATIONS) Makefile
36
$(AM_V_at)LC_ALL=C $(INTLTOOL_MERGE) --multiple-output --xml-style --utf8 --cache=$(top_builddir)/po-locations/.intltool-merge-cache $(top_srcdir)/po-locations $< $(libgweatherlocations_data) && \
37
for pofile in $(PO_LOCATIONS); do \
38
locale=`echo $$pofile | sed "s;$(top_srcdir)/po-locations/\(.*\)\.po;\1;"`; \
39
xmllint --noblanks -o Locations.$$locale.xml $$locale/$(libgweatherlocations_data); \
40
rm -f $$locale/$(libgweatherlocations_data); \
41
test -d $$locale && rmdir $$locale; \
42
if test "x$(COMPRESS_EXT)" = "x.gz"; then \
43
gzip --force Locations.$$locale.xml; \
46
xmllint --noblanks -o Locations.xml C/$(libgweatherlocations_data) && \
47
rm -f C/$(libgweatherlocations_data) && \
48
test -d C && rmdir C && \
49
if test "x$(COMPRESS_EXT)" = "x.gz"; then \
50
gzip --force Locations.xml; \
54
endif # USE_ONE_BIG_XML
56
### Locations.xml.in rebuild
57
rebuild-locations: locationdb.sqlite update-locations.py
58
$(AM_V_GEN)($(srcdir)/update-locations.py > Locations.xml.in.new && mv Locations.xml.in.new Locations.xml.in) || rm -f Locations.xml.in.new
60
locationdb.sqlite: build-locationdb.pl major-cities.txt sources/nsd_cccc.txt sources/POP_PLACES.txt sources/US_CONCISE.txt sources/geonames_dd_dms_date_*.txt city-fixups.pl station-fixups.pl
61
$(AM_V_GEN)$(srcdir)/build-locationdb.pl
17
$(LOCATIONS_STAMP): $(libgweatherlocations_in_files) Makefile
18
LC_ALL=C $(INTLTOOL_MERGE) --multiple-output --xml-style --utf8 --cache=$(top_builddir)/po-locations/.intltool-merge-cache /dev/null $< $(libgweatherlocations_DATA) && \
19
xmllint --noblanks -o Locations.xml C/$(libgweatherlocations_DATA) && \
20
rm -f C/$(libgweatherlocations_DATA) && \
64
24
xmllint --valid --noout $(top_srcdir)/data/Locations.xml.in