[gimp-help-2] [make] Use MAKECMDGOALS to control make
- From: Ulf-D. Ehlert <ulfehlert src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp-help-2] [make] Use MAKECMDGOALS to control make
- Date: Wed, 26 Aug 2009 19:34:21 +0000 (UTC)
commit a2be2dff6d0fee00b981af0305c1ccc27cd812a8
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date: Wed Aug 26 20:10:30 2009 +0200
[make] Use MAKECMDGOALS to control make
* Speed up (or avoid) some operations if target is "help" or "clean".
* Makefile.am: Also force updating explicitely specified po files
(cf. commit 952c94cc068f036b6472e0e937c586d679e5881c, 2009-08-13).
* Makefile.am: clean-up some find predicates.
Makefile.GNU | 14 +++++++-------
Makefile.am | 58 ++++++++++++++++++++--------------------------------------
2 files changed, 27 insertions(+), 45 deletions(-)
---
diff --git a/Makefile.GNU b/Makefile.GNU
index 69e6a23..f284025 100644
--- a/Makefile.GNU
+++ b/Makefile.GNU
@@ -77,7 +77,9 @@ abs_builddir := $(shell pwd)
#odfdir = odf
#logdir = log
-# Find files and directories
+### Find files and directories
+
+# XML files excluding automatically generated files
xml_file_predicates = \
-name '.git' -prune \
-o \
@@ -112,7 +114,7 @@ AUTHORS_DOCBOOK_STYLESHEETS = \
stylesheets/authors_common.xsl
# Files & directories
-ifneq "$(MAKECMDGOALS)" "help"
+ifeq ($(filter help clean,$(MAKECMDGOALS)),)
SRC_DIRS := $(shell cd $(srcdir) && $(find_l) src/ $(src_dir_predicates))
SRC_FILES := $(shell cd $(srcdir) && $(find_l) src/ $(xml_file_predicates)) \
$(AUTHORS_DOCBOOK_XML)
@@ -356,7 +358,7 @@ potfiles: $(POT_FILES)
define MAKE_PO_RULES
$(1)_PO_FILES = $$(patsubst pot/%.pot, po/$(1)/%.po, $$(POT_FILES))
-ifeq ($$(filter $$(MAKECMDGOALS),$$($(1)_PO_FILES)),)
+ifeq ($$(filter po/$(1)/%.po,$$(MAKECMDGOALS)),)
$$($(1)_PO_FILES): po/$(1)/%.po : pot/%.pot
else
$$($(1)_PO_FILES): po/$(1)/%.po : pot/%.pot FORCE
@@ -406,11 +408,9 @@ force-po/%:
#### Generate XML prerequisites ####
########################################################################
-#ifneq "$(MAKECMDGOALS)" "help"
-#ifneq "$(UPDATE)" "nodeps"
+ifeq ($(filter help clean,$(MAKECMDGOALS)),)
include $(foreach LANG,$(PO_LANGS),xml/$(LANG)/.deps.mk)
-#endif
-#endif
+endif
# The dynamically generated and updated ".deps.mk" files contain
# rules to register the po prereqisite for every xml file, e.g.
diff --git a/Makefile.am b/Makefile.am
index e89b71e..f93e71c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -60,39 +60,10 @@ RMAKE = $(MAKE) --no-print-directory
# Standard shell commands
echo_n = echo $(ECHO_N)
-# options for the "find images" command:
-image_find_predicates = \
- -name '.git' -prune \
- -o \
- -type d \
- \( -name '[a-z][a-z]' -o -name '[a-z][a-z]_[A-Z][A-Z]' \) \
- $(image_lang_exclude) \
- -prune \
- -o \
- \( \
- -name '*.png' -o \
- -name '*.jpg' -o \
- -name '*.mng' -o \
- -name '*.xcf' -o \
- -name '*.gif' \
- \) -print
-
-# languages we want to exclude from installing images
-image_lang_exclude = \
- $(shell echo $(strip $(LANGUAGES)) | \
- $(SED) -e '/^$$/d; \
- s/ / -o -name /g; \
- s/^/! \\( -name /; \
- s/$$/ \\)/ ' \
- )
-
-# find HTML files (used when installing html)
-html_files_find_predicates = \
- -type f -name '*.*' \
- -print
+### Find files and directories
# XML files excluding automatically generated files
-src_find_predicates = \
+xml_file_predicates = \
-name '.git' -prune \
-o \
-name '$(notdir $(AUTHORS_DOCBOOK_XML))' -prune \
@@ -128,9 +99,15 @@ AUTHORS_DOCBOOK_STYLESHEETS = \
stylesheets/authors_common.xsl
# lists of source (XML) files and source directories
-SRC_DIRS = $(shell cd $(srcdir) && $(find_l) src/ $(src_dir_predicates))
-SRC_FILES = $(shell cd $(srcdir) && $(find_l) src/ $(src_find_predicates)) \
- $(AUTHORS_DOCBOOK_XML)
+# HIDE FROM AUTOMAKE #ifeq ($(filter help clean,$(MAKECMDGOALS)),)
+# HIDE FROM AUTOMAKE #SRC_DIRS := $(shell cd $(srcdir) && $(find_l) src/ $(src_dir_predicates))
+# HIDE FROM AUTOMAKE #SRC_FILES := $(shell cd $(srcdir) && $(find_l) src/ $(xml_file_predicates)) \
+# HIDE FROM AUTOMAKE # $(AUTHORS_DOCBOOK_XML)
+# HIDE FROM AUTOMAKE #else
+# HIDE FROM AUTOMAKE #SRC_DIRS = $(shell cd $(srcdir) && $(find_l) src/ $(src_dir_predicates))
+# HIDE FROM AUTOMAKE #SRC_FILES = $(shell cd $(srcdir) && $(find_l) src/ $(xml_file_predicates)) \
+# HIDE FROM AUTOMAKE # $(AUTHORS_DOCBOOK_XML)
+# HIDE FROM AUTOMAKE #endif
# lists of PO files (translations)
PO_FILES = $(shell cd $(srcdir) && $(find_l) po/ $(file_predicates))
@@ -388,7 +365,11 @@ potfiles: $(POT_FILES)
#
# HIDE FROM AUTOMAKE #define MAKE_PO_RULES
# HIDE FROM AUTOMAKE #$(1)_PO_FILES = $$(patsubst pot/%.pot, $$(srcdir)/po/$(1)/%.po, $$(POT_FILES))
+# HIDE FROM AUTOMAKE #ifeq ($$(filter po/$(1)/%.po,$$(MAKECMDGOALS)),)
# HIDE FROM AUTOMAKE #$$($(1)_PO_FILES): $$(srcdir)/po/$(1)/%.po : pot/%.pot
+# HIDE FROM AUTOMAKE #else
+# HIDE FROM AUTOMAKE #$$($(1)_PO_FILES): $$(srcdir)/po/$(1)/%.po : pot/%.pot FORCE
+# HIDE FROM AUTOMAKE #endif
# 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
@@ -421,16 +402,17 @@ po-todo-%: po-%
# Force updating po file
update-po/%.po:
- $(cmd) po=$@; pot=pot/$${po#update-po/*/}t; \
- $(RMAKE) $${pot} && touch $${pot} && \
- $(RMAKE) po/$*.po
+ $(msg) "Deprecated, use 'make po/$*.po instead'"
+ $(cmd) false
########################################################################
#### Generate XML prerequisites ####
########################################################################
-include $(foreach LANG,$(PO_LANGS),xml/$(LANG)/.deps.mk)
+# HIDE FROM AUTOMAKE #ifeq ($(filter help clean,$(MAKECMDGOALS)),)
+# HIDE FROM AUTOMAKE #include $(foreach LANG,$(PO_LANGS),xml/$(LANG)/.deps.mk)
+# HIDE FROM AUTOMAKE #endif
# The dynamically generated and updated ".deps.mk" files contain
# rules to register the po prereqisite for every xml file, e.g.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]