1 SRC=$(wildcard *.po) 2 OBJ= $(SRC:.po=.mo) 3 INST= $(SRC:.po=.inst) 4 5 translations: $(OBJ) 6 7 %.mo: %.po 8 msgfmt -o $@ $< 9 10 clean: 11 rm -f *.mo *~ 12 13 # hack to automate installation dynamicaly, without previous knowledge of 14 # the po/mo file list (we fool make by pretending the need for .inst files). 15 install: $(OBJ) $(INST) 16 17 %.inst: %.mo 18 mkdir -p $(DESTDIR)$(LOCALESDIR)/$*/LC_MESSAGES/ 19 -cp -f $< $(DESTDIR)$(LOCALESDIR)/$*/LC_MESSAGES/powertop.mo 20 21 uptrans: $(LG).po 22 23 $(LG).po: powertop.pot 24 ifdef LG 25 msgmerge -U $@ $< 26 else 27 @echo "Usage : make uptrans LG=xx # with xx = de, es, fi ..." 28 @exit 1 29 endif 30 31