Having the name of the domain hard-coded in many places in the makefiles
makes it harder to maintain them, specially because much code is duplicated
between the makefiles that handle po files.

There is now the variable DOMAIN that is set once in each concerned
makefile, and the rest of the makefile makes use of it.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 WINGs/po/Makefile.am      | 16 +++++++++-------
 WPrefs.app/po/Makefile.am | 16 +++++++++-------
 po/Makefile.am            | 16 +++++++++-------
 util/po/Makefile.am       | 16 +++++++++-------
 4 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/WINGs/po/Makefile.am b/WINGs/po/Makefile.am
index ddc0edc..857730d 100644
--- a/WINGs/po/Makefile.am
+++ b/WINGs/po/Makefile.am
@@ -1,8 +1,10 @@
+DOMAIN = WINGs
+
 nlsdir      = $(NLSDIR)
 
 CATALOGS = @WINGSMOFILES@
 
-CLEANFILES = $(CATALOGS) WINGs.pot
+CLEANFILES = $(CATALOGS) $(DOMAIN).pot
 
 EXTRA_DIST = bg.po ca.po cs.po de.po fr.po hu.po nl.po sk.po
 
@@ -77,13 +79,13 @@ SUFFIXES = .po .mo
 
 all-local: $(CATALOGS)
 
-WINGs.pot: $(POTFILES)
-       xgettext --default-domain=WINGs \
+$(DOMAIN).pot: $(POTFILES)
+       xgettext --default-domain=$(DOMAIN) \
        --add-comments --keyword=_ --keyword=N_ $(POTFILES)
-       if cmp -s WINGs.po WINGs.pot; then \
-           rm -f WINGs.po; \
+       if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
+           rm -f $(DOMAIN).po; \
        else \
-           mv -f WINGs.po WINGs.pot; \
+           mv -f $(DOMAIN).po $(DOMAIN).pot; \
        fi
 
 install-data-local:  $(CATALOGS)
@@ -92,7 +94,7 @@ install-data-local:  $(CATALOGS)
                if test "$$n" -a "$$n" != "__DuMmY" ; then \
                        l=`basename $$n .mo`; \
                        $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
-                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/WINGs.mo; \
+                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
                fi; \
        done
 
diff --git a/WPrefs.app/po/Makefile.am b/WPrefs.app/po/Makefile.am
index 393900f..7b6b7cb 100644
--- a/WPrefs.app/po/Makefile.am
+++ b/WPrefs.app/po/Makefile.am
@@ -1,8 +1,10 @@
+DOMAIN = WPrefs
+
 CATALOGS = @WPMOFILES@
 
 nlsdir = $(NLSDIR)
 
-CLEANFILES = WPrefs.pot $(CATALOGS)
+CLEANFILES = $(DOMAIN).pot $(CATALOGS)
 
 EXTRA_DIST = bg.po ca.po cs.po de.po es.po et.po fi.po fr.po hr.po hu.po \
        it.po ja.po ko.po nl.po pt.po ru.po sk.po zh_CN.po zh_TW.po
@@ -43,13 +45,13 @@ SUFFIXES = .po .mo
 
 all-local: $(CATALOGS)
 
-WPrefs.pot: $(POTFILES)
-       xgettext --default-domain=WPrefs \
+$(DOMAIN).pot: $(POTFILES)
+       xgettext --default-domain=$(DOMAIN) \
        --add-comments --keyword=_ --keyword=N_ $(POTFILES)
-       if cmp -s WPrefs.po WPrefs.pot; then \
-           rm -f WPrefs.po; \
+       if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
+           rm -f $(DOMAIN).po; \
        else \
-           mv -f WPrefs.po WPrefs.pot; \
+           mv -f $(DOMAIN).po $(DOMAIN).pot; \
        fi
 
 
@@ -59,7 +61,7 @@ install-data-local:  $(CATALOGS)
                if test "$$n" -a "$$n" != "__DuMmY" ; then \
                        l=`basename $$n .mo`; \
                        $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
-                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/WPrefs.mo; \
+                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
                fi; \
        done
 
diff --git a/po/Makefile.am b/po/Makefile.am
index da9b1e0..242a174 100644
--- a/po/Makefile.am
+++ b/po/Makefile.am
@@ -1,8 +1,10 @@
+DOMAIN = WindowMaker
+
 nlsdir      = $(NLSDIR)
 
 CATALOGS = @MOFILES@
 
-CLEANFILES = $(CATALOGS) WindowMaker.pot
+CLEANFILES = $(CATALOGS) $(DOMAIN).pot
 
 # Please keep this sorted in alphabetic order!
 EXTRA_DIST = be.po bg.po bs.po ca.po cs.po da.po de.po el.po es.po et.po \
@@ -72,13 +74,13 @@ SUFFIXES = .po .mo
 
 all-local: $(CATALOGS)
 
-WindowMaker.pot: $(POTFILES)
-       xgettext --default-domain=WindowMaker \
+$(DOMAIN).pot: $(POTFILES)
+       xgettext --default-domain=$(DOMAIN) \
        --add-comments --keyword=_ --keyword=N_ $(POTFILES)
-       if cmp -s WindowMaker.po WindowMaker.pot; then \
-           rm -f WindowMaker.po; \
+       if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
+           rm -f $(DOMAIN).po; \
        else \
-           mv -f WindowMaker.po WindowMaker.pot; \
+           mv -f $(DOMAIN).po $(DOMAIN).pot; \
        fi
 
 install-data-local:  $(CATALOGS)
@@ -87,7 +89,7 @@ install-data-local:  $(CATALOGS)
                if test "$$n" -a "$$n" != "__DuMmY" ; then \
                        l=`basename $$n .mo`; \
                        $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
-                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/WindowMaker.mo; \
+                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
                fi; \
        done
 
diff --git a/util/po/Makefile.am b/util/po/Makefile.am
index f73a03b..d1b113c 100644
--- a/util/po/Makefile.am
+++ b/util/po/Makefile.am
@@ -1,8 +1,10 @@
+DOMAIN = wmgenmenu
+
 CATALOGS = @UTILMOFILES@
 
 nlsdir = $(NLSDIR)
 
-CLEANFILES = wmgenmenu.pot $(CATALOGS)
+CLEANFILES = $(DOMAIN).pot $(CATALOGS)
 
 EXTRA_DIST = de.po es.po fr.po nl.po pt.po
 
@@ -18,13 +20,13 @@ SUFFIXES = .po .mo
 
 all-local: $(CATALOGS)
 
-wmgenmenu.pot: $(POTFILES)
-       xgettext --default-domain=wmgenmenu \
+$(DOMAIN).pot: $(POTFILES)
+       xgettext --default-domain=$(DOMAIN) \
        --add-comments --keyword=_ --keyword=N_ $(POTFILES)
-       if cmp -s wmgenmenu.po wmgenmenu.pot; then \
-           rm -f wmgenmenu.po; \
+       if cmp -s $(DOMAIN).po $(DOMAIN).pot; then \
+           rm -f $(DOMAIN).po; \
        else \
-           mv -f wmgenmenu.po wmgenmenu.pot; \
+           mv -f $(DOMAIN).po $(DOMAIN).pot; \
        fi
 
 
@@ -34,6 +36,6 @@ install-data-local:  $(CATALOGS)
                if test "$$n" -a "$$n" != "__DuMmY" ; then \
                        l=`basename $$n .mo`; \
                        $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
-                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/wmgenmenu.mo; \
+                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
                fi; \
        done
-- 
2.1.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to