| 1 |
DESKTOP_SRC := $(wildcard *.desktop.in) |
| 2 |
DESKTOP := $(DESKTOP_SRC:.in=) |
| 3 |
DESC_SRC := $(wildcard descriptions/*.desktop.in) |
| 4 |
DESC := $(DESC_SRC:.in=) |
| 5 |
METAINFO_SRC := $(wildcard *.metainfo.xml.in) |
| 6 |
METAINFO := $(METAINFO_SRC:.in=) |
| 7 |
GLADE := $(wildcard glade/*.glade) |
| 8 |
UI := $(wildcard glade/*.ui) |
| 9 |
GLADE += $(UI:.ui=.glade) |
| 10 |
TRANSLATION_SRC := $(wildcard translations/*.po) |
| 11 |
TRANSLATION := $(TRANSLATION_SRC:translations/%.po=locale/%/LC_MESSAGES/galternatives.mo) |
| 12 |
SRC := $(wildcard ../galternatives/*.py) |
| 13 |
|
| 14 |
|
| 15 |
.PHONY: all |
| 16 |
all: $(DESKTOP) $(DESC) $(METAINFO) $(TRANSLATION) |
| 17 |
|
| 18 |
%.desktop: %.desktop.in |
| 19 |
intltool-merge -d translations $< $@ |
| 20 |
|
| 21 |
%.metainfo.xml: %.metainfo.xml.in |
| 22 |
intltool-merge -d translations -x $< $@ |
| 23 |
|
| 24 |
locale/%/LC_MESSAGES/galternatives.mo: translations/%.po |
| 25 |
mkdir -p $(dir $@) |
| 26 |
msgfmt --statistics -o $@ $< |
| 27 |
|
| 28 |
.PHONY: extract |
| 29 |
extract: translations/POTFILES.in |
| 30 |
(cd translations; intltool-update -g galternatives -p) |
| 31 |
|
| 32 |
translations/POTFILES.in: $(SRC) $(DESKTOP_SRC) $(DESC_SRC) $(METAINFO_SRC) $(GLADE) |
| 33 |
echo '[encoding: UTF-8]' > $@ |
| 34 |
echo $? | sed -e 's/ /\n/g' >> $@ |
| 35 |
|
| 36 |
%.glade: %.ui |
| 37 |
ln -s $(notdir $<) $@ |
| 38 |
|
| 39 |
.PHONY: update |
| 40 |
update: $(TRANSLATION_SRC:.po=.update.po) |
| 41 |
|
| 42 |
%.update.po: %.po |
| 43 |
msgmerge -o $@ $< translations/galternatives.pot |
| 44 |
mv $@ $< |
| 45 |
|
| 46 |
.PHONY: clean |
| 47 |
clean: |
| 48 |
rm -f $(DESKTOP) $(DESC) $(UI:.ui=.glade) translations/POTFILES.in |
| 49 |
rm -rf locale |