generated from Crell/php-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
51 lines (39 loc) · 1.14 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# See https://tech.davis-hansson.com/p/make/ for how all of these customizations work.
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
compose_command = docker-compose run -u $(id -u ${USER}):$(id -g ${USER}) --rm php81
build: tmp/.docker-built
tmp/.docker-built: docker-compose.yml docker/php/81/Dockerfile
> mkdir -p $(@D) # Makes the tmp directory
> docker-compose build
> touch $@ # Touches the file that is this target.
shell: build
> $(compose_command) bash
.PHONY: shell
destroy:
> docker-compose down -v
> rm -rf tmp
.PHONY: destroy
composer: build
> $(compose_command) composer install
.PHONY: composer
test: build
> $(compose_command) vendor/bin/phpunit
.PHONY: test
phpstan: build
> $(compose_command) vendor/bin/phpstan
.PHONY: phpstan
profile: build
> $(compose_command) php profile.php
.PHONY: profile
blackfire:
> $(compose_command) blackfire run php profile.php
.PHONY: blackfire