-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathMakefile
37 lines (31 loc) · 1.33 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.DEFAULT_GOAL := help
SHELL := /bin/bash
COMPOSER_BIN ?= composer
PHP_BIN ?= php
## ----------------------------------------------------------------------
## To generate churn.phar, run: make clean build
## To also set the version, run: COMPOSER_ROOT_VERSION=x.y.z make clean build
## ----------------------------------------------------------------------
.PHONY: help
help: ## Show this help
help:
@sed -ne '/@sed/!s/## //p' $(MAKEFILE_LIST)
.PHONY: box
box: ## Download box.phar
box:
test -e build/box.phar || curl -sL https://github.com/box-project/box/releases/download/3.16.0/box.phar -o build/box.phar
chmod +x build/box.phar
.PHONY: build
build: ## Build churn.phar
build: box
scp -r src bin composer.json box.json.dist manifest.xml LICENSE.md build/
$(COMPOSER_BIN) config platform.php 7.1.3 --working-dir=build/
$(COMPOSER_BIN) update --no-dev --no-interaction --prefer-dist --working-dir=build/
CHURN_VERSION=$$( $(PHP_BIN) build/bin/churn --version --no-ansi | grep -Po '(?<= )[^@]+' ) ;\
sed -i -e "[email protected]@$${CHURN_VERSION}@g" build/manifest.xml
$(PHP_BIN) build/box.phar validate build/box.json.dist
$(PHP_BIN) build/box.phar compile --working-dir=build/
.PHONY: clean
clean: ## Clean the build folder
clean:
(cd build && rm -rf src bin composer.json box.json.dist manifest.xml LICENSE.md vendor composer.lock box.phar churn.phar)