[gjs/wip/ptomato/autotools: 4/7] build: Use := for Makefile vars with $(shell)



commit 069d2606c5d0389be6f123c8e0a121a0bcb75aca
Author: Philip Chimento <philip chimento gmail com>
Date:   Thu Sep 29 12:53:19 2016 -0700

    build: Use := for Makefile vars with $(shell)
    
    If you use = to assign a value consisting of a $(shell) invocation, then
    Make will keep shelling out and running the same process over and over
    every time the variable is used. Instead use := which computes the value
    only once.

 Makefile-modules.am |    2 +-
 Makefile-test.am    |    2 +-
 Makefile.am         |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/Makefile-modules.am b/Makefile-modules.am
index 5cdbd28..589ac4b 100644
--- a/Makefile-modules.am
+++ b/Makefile-modules.am
@@ -15,7 +15,7 @@ JS_NATIVE_MODULE_CPPFLAGS =   \
 JS_NATIVE_MODULE_LIBADD =      \
         $(GJS_LIBS)
 
-modules_resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/modules/modules.gresource.xml)
+modules_resource_files := $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/modules/modules.gresource.xml)
 modules-resources.h: $(srcdir)/modules/modules.gresource.xml $(modules_resource_files)
        $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) 
--generate --c-name modules_resources $<
 modules-resources.c: $(srcdir)/modules/modules.gresource.xml $(modules_resource_files)
diff --git a/Makefile-test.am b/Makefile-test.am
index ade9cfe..7b82863 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -51,7 +51,7 @@ gjs_tests_CPPFLAGS =                          \
        $(gjs_directory_defines)                \
        -I$(top_srcdir)/test
 
-mock_js_resources_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/test/mock-js-resources.gresource.xml)
+mock_js_resources_files := $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/test/mock-js-resources.gresource.xml)
 mock-js-resources.h: $(srcdir)/test/mock-js-resources.gresource.xml $(modules_resource_files)
        $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --sourcedir=$(builddir) 
--generate --c-name mock_js_resources $<
 mock-js-resources.c: $(srcdir)/test/mock-js-resources.gresource.xml $(modules_resource_files)
diff --git a/Makefile.am b/Makefile.am
index 3a8e508..9f58d38 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -250,7 +250,7 @@ COMPRESSION=.bz2
 PACKAGE=@PACKAGE@
 VERSION=@VERSION@
 DISTNAME=$(PACKAGE)-$(VERSION).tar$(COMPRESSION)
-TAG_VERSION=$(shell echo $(VERSION) |sed s/\\\./_/g)
+TAG_VERSION := $(shell echo $(VERSION) |sed s/\\\./_/g)
 
 prepare-release-tag: Makefile
        git tag -m "Tag $(TAG_VERSION)" -a $(TAG_PREFIX)$(TAG_VERSION)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]