From 769fe6be0d15669eec7308b6f8d1e17124187814 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 25 Jan 2016 12:18:07 +0100 Subject: [PATCH] less $(shell), better Makefile --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index dbed4c3..edaf87b 100644 --- a/Makefile +++ b/Makefile @@ -28,9 +28,10 @@ with_php_config ?= $(bindir)/php-config extdir = $(shell test -x $(with_php_config) && $(with_php_config) --extension-dir) PECL_MIRROR ?= http://pecl.php.net/get/ -PECL_EXTENSION ?= $(shell echo $(PECL) | cut -d: -f1) -PECL_SONAME ?= $(if $(shell echo $(PECL) | cut -d: -f2),$(shell echo $(PECL) | cut -d: -f2),$(PECL_EXTENSION)) -PECL_VERSION ?= $(shell echo $(PECL) | cut -d: -f3 -s) +PECL_WORDS := $(subst :, ,$(PECL)) +PECL_EXTENSION ?= $(word 1,$(PECL_WORDS)) +PECL_SONAME ?= $(if $(word 2,$(PECL_WORDS)),$(word 2,$(PECL_WORDS)),$(PECL_EXTENSION)) +PECL_VERSION ?= $(word 3,$(PECL_WORDS)) PECL_INI = $(with_config_file_scan_dir)/pecl.ini PECL_DIR := $(if $(filter ext ext%, $(MAKECMDGOALS)), $(curdir), $(srcdir)/pecl-$(PECL_EXTENSION)) -- 2.30.2