+$(PECL_DIR)/config.m4:
+ if test "$(PECL_VERSION)" = "master"; then \
+ if test -d $(PECL_DIR); then \
+ cd $(PECL_DIR); \
+ git pull; \
+ else \
+ git clone https://github.com/$(PECL_EXTENSION) $(PECL_DIR); \
+ fi; \
+ else \
+ mkdir -p $(PECL_DIR); \
+ curl -LSs $(PECL_MIRROR)/$(PECL_EXTENSION)$(if $(PECL_VERSION),/$(PECL_VERSION)) \
+ | tar xz --strip-components 1 -C $(PECL_DIR); \
+ fi
+
+$(PECL_DIR)/configure: $(PECL_DIR)/config.m4
+ cd $(PECL_DIR) && $(bindir)/phpize
+
+$(PECL_DIR)/Makefile: $(PECL_DIR)/configure
+ cd $(PECL_DIR) && ./configure --cache-file=config.cache
+
+$(PECL_DIR)/.libs/$(PECL_SONAME).so: $(PECL_DIR)/Makefile
+ cd $(PECL_DIR) && make -j $(JOBS) || make
+
+$(extdir)/$(PECL_SONAME).so: $(PECL_DIR)/.libs/$(PECL_SONAME).so $(extdir)
+ cd $(PECL_DIR) && make -j $(JOBS) install INSTALL=install
+
+.PHONY: pecl
+pecl: pecl-check php $(extdir)/$(PECL_SONAME).so | $(PECL_INI)
+ grep -q extension=$(PECL_SONAME).so $(PECL_INI) || echo extension=$(PECL_SONAME).so >> $(PECL_INI)