File: Makefile

package info (click to toggle)
llgal 0.13.19-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 616 kB
  • sloc: perl: 2,821; makefile: 132; php: 15
file content (40 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download | duplicates (8)
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
.PHONY: all update clean install uninstall

# To change the locales that are generated, you have to pass
# something like LOCALES="fr de" on the command line

# locales that are supported
SUPPORTED_PO_FILES	=	$(wildcard *.po)
SUPPORTED_LOCALES	=	$(patsubst %.po,%,$(SUPPORTED_PO_FILES))

# by default, build all supported locales
LOCALES	=	$(SUPPORTED_LOCALES)

# locales that actually have to be built/installed
# (needed to drop the unsupported/duplicated ones that the user requests)
BUILT_LOCALES	=	$(sort $(filter $(SUPPORTED_LOCALES),$(LOCALES)))
BUILT_MO_FILES	=	$(patsubst %,%.mo,$(BUILT_LOCALES))

all: update

update:: $(BUILT_MO_FILES)

$(BUILT_MO_FILES): %.mo: %.po
	msgfmt $< -o $@

clean::
	$(RM) $(BUILT_MO_FILES)

install::
	for lang in $(BUILT_LOCALES) ; do \
		install -d -m 0755 $(LOCALEDIR)/$${lang}/LC_MESSAGES/ ; \
		install -m 0644 $${lang}.mo $(LOCALEDIR)/$${lang}/LC_MESSAGES/llgal.mo ; \
	done

uninstall::
	for lang in $(BUILT_LOCALES) ; do \
		rm $(LOCALEDIR)/$${lang}/LC_MESSAGES/llgal.mo ; \
		rmdir $(LOCALEDIR)/$${lang}/LC_MESSAGES/ ; \
		rmdir $(LOCALEDIR)/$${lang}/ ; \
	done
	rmdir $(LOCALEDIR)/