jwt/Makefile

66 lines
1.4 KiB
Makefile

ROOT := $(realpath .)
export ROOT
PHPSTAN_CONFIG := $(realpath phpstan.neon)
export PHPSTAN_CONFIG
SRC_DIR := $(realpath src)
export SRC_DIR
DEV_TARGETS := install update analyse analyze
DEV_DIR := $(realpath dev)
DEV_DIRS := $(wildcard ${DEV_DIR}/*)
VENDOR := $(realpath vendor)
VENDOR_BIN := ${VENDOR}/bin
PHP_702 := $(shell which php7.2)
export PHP_702
PHP_703 := $(shell which php7.3)
export PHP_703
PHP_704 := $(shell which php7.4)
export PHP_704
PHP_800 := $(shell which php8.0)
export PHP_800
PHP_801 := $(shell which php8.1)
export PHP_801
PHP_802 := $(shell which php8.2)
export PHP_802
PHP_803 := $(shell which php8.3)
export PHP_803
PHP_804 := $(shell which php8.4)
export PHP_804
COMPOSER := $(shell which composer)
export COMPOSER
SUDO = $(shell which sudo)
USER_NAME = $(shell id -un)
GROUP_NAME = $(shell id -gn)
${DEV_TARGETS}: ${DEV_DIRS}
install:
${PHP_702} ${COMPOSER} install
update:
${PHP_702} ${COMPOSER} update
tests:
${PHP_702} ${VENDOR_BIN}/phpunit
${PHP_703} ${VENDOR_BIN}/phpunit
${PHP_704} ${VENDOR_BIN}/phpunit
${PHP_800} ${VENDOR_BIN}/phpunit
${PHP_801} ${VENDOR_BIN}/phpunit
${PHP_802} ${VENDOR_BIN}/phpunit
${PHP_803} ${VENDOR_BIN}/phpunit
${PHP_804} ${VENDOR_BIN}/phpunit
fix-perms: # WSL skill issues
${SUDO} chown -R ${USER_NAME}:${GROUP_NAME} .
${DEV_DIRS}:
${MAKE} -C $@ ${MAKECMDGOALS}
.PHONY: ${DEV_TARGETS} ${DEV_DIRS} fix-perms tests