[gimp-help-2] [make] Clean up the clean-up rules
- From: Ulf-D. Ehlert <ulfehlert src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp-help-2] [make] Clean up the clean-up rules
- Date: Thu, 17 Sep 2009 19:04:12 +0000 (UTC)
commit 21a2624f85f345cbca894efb2fb9aea6609fc26b
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date: Thu Sep 17 20:31:52 2009 +0200
[make] Clean up the clean-up rules
Makefile.GNU | 22 +++++++++++++---------
Makefile.am | 21 +++++++++++++--------
2 files changed, 26 insertions(+), 17 deletions(-)
---
diff --git a/Makefile.GNU b/Makefile.GNU
index 2d51961..2e5ff7b 100644
--- a/Makefile.GNU
+++ b/Makefile.GNU
@@ -320,9 +320,10 @@ pot/%.pot: src/%/*.xml
# Targets suitable for command line
# ("make pot" will work even if pot exists)
-pot: potfiles ;
-potfiles: $(POT_FILES)
- $(msg) "--- Cleaning up pot files ..."
+pot: potfiles cleanup-pot ;
+potfiles: $(POT_FILES) ;
+cleanup-pot:
+ $(msg) "Cleaning up pot files ..."
$(cmd) $(find_l) pot/ $(pot_file_predicates) | \
while read potfile; do \
potfile=$${potfile#pot/}; srcfile=src/$${potfile%.pot}.xml \
@@ -344,8 +345,10 @@ endif
$$(cmd) $$(call make_target_dir,$$@)
$$(msg) "[PO] $$@"
$$(cmd) if test -s $$<; then $$(call pot2po,$$<,$(1),$$@); else touch $$@; fi
-po-$(1): $$($(1)_PO_FILES)
+po-$(1): $$($(1)_PO_FILES) cleanup-po-$(1)
$$(cmd) if test -e messages.mo; then rm -f messages.mo; fi
+cleanup-po-$(1):
+ $$(msg) "Cleaning up po files ..."
$$(cmd) $(find_l) po/$(1)/ $$(po_file_predicates) | \
while read pofile; do \
potfile=pot/$$$${pofile#po/$(1)/}t; \
@@ -434,11 +437,11 @@ xml/$(1)/%.xml:
$(call po2xml,$$$${srcfile},$$$${pofile},$(1),$$@)
# This is indirectly used as HTML and PDF prerequisite:
-xml/$(1): $$($(1)_XML_FILES)
+xml/$(1): $$($(1)_XML_FILES) | xml/$(1)/images
$$(cmd) test -d $$@ && touch $$@ || $(mkdir_p) $$@
# Targets suitable for command line
-xml-$(1): xml/$(1) $$($(1)_XML_FILES) xml/$(1)/images ;
+xml-$(1): xml/$(1) cleanup-xml-$(1) ;
endef
$(foreach LANG,$(PO_LANGS),$(eval $(call MAKE_XML_RULES,$(LANG))))
@@ -450,9 +453,11 @@ $(en_XML_FILES): xml/en/%.xml : src/%.xml
$(cmd) $(call make_target_dir,$@)
$(cmd) cp -f $< $@
-xml/en: $(en_XML_FILES)
+xml/en: $(en_XML_FILES) | xml/en/images
$(cmd) test -d $@ && touch $@ || $(mkdir_p) $@
+xml-en: xml/en cleanup-xml-en ;
+
# Images
ifeq ($(MAKE_IMAGES), lazy)
@@ -474,18 +479,17 @@ xml/%/images: $(IMAGE_PREREQ)
# remove stale xml files
cleanup-xml-%:
+ $(msg) "Cleaning up xml files ..."
$(cmd) $(find_l) xml/$*/ $(xml_file_predicates) | \
while read xmlfile; do \
test -e src/$${xmlfile#xml/$*/} || rm -vf $${xmlfile}; \
done
# Target suitable for command line
-xml-en: cleanup-xml-en xml/en $(en_XML_FILES) ;
xml-images-%: xml/%/images ;
images-%: xml-images-% html-images-% ;
.PRECIOUS: xml/%/images
-
.PHONY: FORCE
FORCE: ;
diff --git a/Makefile.am b/Makefile.am
index 8e1136f..5c8775f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -339,9 +339,10 @@ pot/%.pot: $(srcdir)/src/%/*.xml
# Targets suitable for command line
# ("make pot" will work even if pot exists)
-pot: potfiles ;
-potfiles: $(POT_FILES)
- $(msg) "--- Cleaning up pot files ..."
+pot: potfiles cleanup-pot ;
+potfiles: $(POT_FILES) ;
+cleanup-pot:
+ $(msg) "Cleaning up pot files ..."
$(cmd) $(find_l) pot/ $(pot_file_predicates) | \
while read potfile; do \
potfile=$${potfile#pot/}; srcfile=src/$${potfile%.pot}.xml \
@@ -363,8 +364,10 @@ potfiles: $(POT_FILES)
# HIDE FROM AUTOMAKE # $$(cmd) $$(call make_target_dir,$$@)
# HIDE FROM AUTOMAKE # $$(msg) "[PO] $$@"
# HIDE FROM AUTOMAKE # $$(cmd) if test -s $$<; then $$(call pot2po,$$<,$(1),$$@); else touch $$@; fi
-# HIDE FROM AUTOMAKE #po-$(1): $$($(1)_PO_FILES)
+# HIDE FROM AUTOMAKE #po-$(1): $$($(1)_PO_FILES) cleanup-po-$(1)
# HIDE FROM AUTOMAKE # $$(cmd) if test -e messages.mo; then rm -f messages.mo; fi
+# HIDE FROM AUTOMAKE #cleanup-po-$(1):
+# HIDE FROM AUTOMAKE # $$(msg) "Cleaning up po files ..."
# HIDE FROM AUTOMAKE # $$(cmd) $(find_l) po/$(1)/ $$(po_file_predicates) | \
# HIDE FROM AUTOMAKE # while read pofile; do \
# HIDE FROM AUTOMAKE # potfile=pot/$$$${pofile#po/$(1)/}t; \
@@ -453,11 +456,11 @@ update-po/%.po:
# HIDE FROM AUTOMAKE # $(call po2xml,$$$${srcfile},$$$${pofile},$(1),$$@)
# HIDE FROM AUTOMAKE #
# HIDE FROM AUTOMAKE ## This is indirectly used as HTML and PDF prerequisite:
-# HIDE FROM AUTOMAKE #xml/$(1): $$($(1)_XML_FILES)
+# HIDE FROM AUTOMAKE #xml/$(1): $$($(1)_XML_FILES) | xml/$(1)/images
# HIDE FROM AUTOMAKE # $$(cmd) test -d $$@ && touch $$@ || $(mkdir_p) $$@
# HIDE FROM AUTOMAKE #
# HIDE FROM AUTOMAKE ## Targets suitable for command line
-# HIDE FROM AUTOMAKE #xml-$(1): xml/$(1) $$($(1)_XML_FILES) xml/$(1)/images ;
+# HIDE FROM AUTOMAKE #xml-$(1): xml/$(1) cleanup-xml-$(1) ;
# HIDE FROM AUTOMAKE #endef
# HIDE FROM AUTOMAKE #$(foreach LANG,$(PO_LANGS),$(eval $(call MAKE_XML_RULES,$(LANG))))
@@ -469,9 +472,11 @@ $(en_XML_FILES): xml/en/%.xml : src/%.xml
$(cmd) $(call make_target_dir,$@)
$(cmd) cp -f $< $@
-xml/en: $(en_XML_FILES)
+xml/en: $(en_XML_FILES) | xml/en/images
$(cmd) test -d $@ && touch $@ || $(MKDIR_P) $@
+xml-en: xml/en cleanup-xml-en ;
+
# Images
# TODO: test new image files structure;
@@ -490,13 +495,13 @@ xml/%/images: FORCE
# remove stale xml files
cleanup-xml-%:
+ $(msg) "Cleaning up xml files ..."
$(cmd) $(find_l) xml/$*/ $(xml_file_predicates) | \
while read xmlfile; do \
test -e src/$${xmlfile#xml/$*/} || rm -vf $${xmlfile}; \
done
# Target suitable for command line
-xml-en: cleanup-xml-en xml/en $(en_XML_FILES) ;
xml-images-%: xml/%/images ;
images-%: xml-images-% html-images-% ;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]