forked from giggls/mapnik-german-l10n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (45 loc) · 1.85 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 'Makefile'
# Get extension version number from debian/changelog
EXTVERSION=$(shell head -n1 debian/changelog |cut -d \( -f 2 |cut -d \) -f 1)
EXTDIR=$(shell pg_config --sharedir)
SUBDIRS = kanjitranscript icutranslit
CLEANDIRS = $(SUBDIRS:%=clean-%)
INSTALLDIRS = $(SUBDIRS:%=install-%)
all: $(patsubst %.md,%.html,$(wildcard *.md)) INSTALL README Makefile $(SUBDIRS) osml10n.control country_languages.data osml10n_country_osm_grid.data
INSTALL: INSTALL.md
pandoc --from markdown_github --to plain --standalone $< --output $@
README: README.md
pandoc --from markdown_github --to plain --standalone $< --output $@
%.html: %.md
pandoc --from markdown_github --to html --standalone $< --output $@
.PHONY: subdirs $(SUBDIRS)
subdirs:
$(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
# I have no idea how to use the Makefile from "pg_config --pgxs"
# for installation without interfering mine
# so will do it manually (fo now)
install: $(INSTALLDIRS) all
mkdir -p $(DESTDIR)$(EXTDIR)/extension
install -D -c -m 644 osml10n--$(EXTVERSION).sql $(DESTDIR)$(EXTDIR)/extension/
install -D -c -m 644 osml10n.control $(DESTDIR)$(EXTDIR)/extension/
install -D -c -m 644 *.data $(DESTDIR)$(EXTDIR)/extension/
$(INSTALLDIRS):
$(MAKE) -C $(@:install-%=%) install
deb:
dpkg-buildpackage -b -us -uc
clean: $(CLEANDIRS)
rm -rf $$(grep -v country_osm_grid.sql .gitignore)
# remove everything including the files from the interwebs
mrproper: clean
rm country_osm_grid.sql
rm country_languages.data
$(CLEANDIRS):
$(MAKE) -C $(@:clean-%=%) clean
osml10n--$(EXTVERSION).sql: plpgsql/*.sql country_languages.data
./genextension.sh $(EXTDIR)/extension $(EXTVERSION)
osml10n.control: osml10n--$(EXTVERSION).sql
sed -e "s/VERSION/$(EXTVERSION)/g" osml10n.control.in >osml10n.control
country_languages.data:
grep -v \# country_languages.data.in >country_languages.data