File: Makefile

package info (click to toggle)
galternatives 1.0.10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 580 kB
  • sloc: python: 1,287; makefile: 48
file content (49 lines) | stat: -rw-r--r-- 1,346 bytes parent folder | download
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
DESKTOP_SRC := $(wildcard *.desktop.in)
DESKTOP := $(DESKTOP_SRC:.in=)
DESC_SRC := $(wildcard descriptions/*.desktop.in)
DESC := $(DESC_SRC:.in=)
METAINFO_SRC := $(wildcard *.metainfo.xml.in)
METAINFO := $(METAINFO_SRC:.in=)
GLADE := $(wildcard glade/*.glade)
UI := $(wildcard glade/*.ui)
GLADE += $(UI:.ui=.glade)
TRANSLATION_SRC := $(wildcard translations/*.po)
TRANSLATION := $(TRANSLATION_SRC:translations/%.po=locale/%/LC_MESSAGES/galternatives.mo)
SRC := $(wildcard ../galternatives/*.py)


.PHONY: all
all: $(DESKTOP) $(DESC) $(METAINFO) $(TRANSLATION)

%.desktop: %.desktop.in
	intltool-merge -d translations $< $@

%.metainfo.xml: %.metainfo.xml.in
	intltool-merge -d translations -x $< $@

locale/%/LC_MESSAGES/galternatives.mo: translations/%.po
	mkdir -p $(dir $@)
	msgfmt --statistics -o $@ $<

.PHONY: extract
extract: translations/POTFILES.in
	(cd translations; intltool-update -g galternatives -p)

translations/POTFILES.in: $(SRC) $(DESKTOP_SRC) $(DESC_SRC) $(METAINFO_SRC) $(GLADE)
	echo '[encoding: UTF-8]' > $@
	echo $? | sed -e 's/ /\n/g' >> $@

%.glade: %.ui
	ln -s $(notdir $<) $@

.PHONY: update
update: $(TRANSLATION_SRC:.po=.update.po)

%.update.po: %.po
	msgmerge -o $@ $< translations/galternatives.pot
	mv $@ $<

.PHONY: clean
clean:
	rm -f $(DESKTOP) $(DESC) $(UI:.ui=.glade) translations/POTFILES.in
	rm -rf locale