From 728f1fc6f98112d4c287a80c04c8457228ed6101 Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Thu, 23 Apr 2020 10:10:25 +0200 Subject: [PATCH] Update Makefile to latest from anax/commons. --- Makefile | 125 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 56 deletions(-) diff --git a/Makefile b/Makefile index 3b72cbc..f23750e 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ WARN_COLOR = \033[33;01m ACTION_MESSAGE = $(ECHO) "$(ACTION)---> $(1)$(NO_COLOR)" # Which makefile am I in? -WHERE-AM-I = $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +WHERE-AM-I = "$(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))" THIS_MAKEFILE := $(call WHERE-AM-I) # Echo some nice helptext based on the target comment @@ -255,7 +255,8 @@ install-tools-php: curl -Lso $(PHPCBF) https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar && chmod 755 $(PHPCBF) - curl -Lso $(PHPMD) http://static.phpmd.org/php/latest/phpmd.phar && chmod 755 $(PHPMD) + curl -Lso $(PHPMD) https://github.com/phpmd/phpmd/releases/download/2.7.0/phpmd.phar && chmod 755 $(PHPMD) + # curl -Lso $(PHPMD) http://static.phpmd.org/php/latest/phpmd.phar && chmod 755 $(PHPMD) # curl -Lso $(PHPMD) http://www.student.bth.se/~mosstud/download/phpmd.phar && chmod 755 $(PHPMD) curl -Lso $(PHPLOC) https://phar.phpunit.de/phploc.phar && chmod 755 $(PHPLOC) @@ -361,7 +362,7 @@ behat: install-tools-bash: @$(call HELPTEXT,$@) # Shellcheck - curl -s https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz | tar -xJ -C build/ && rm -f .bin/shellcheck && ln build/shellcheck-latest/shellcheck .bin/ + curl -Ls https://github.com/koalaman/shellcheck/releases/download/latest/shellcheck-latest.linux.x86_64.tar.xz | tar -xJ -C build/ && rm -f .bin/shellcheck && ln build/shellcheck-latest/shellcheck .bin/ # Bats curl -Lso $(BIN)/bats-exec-suite https://raw.githubusercontent.com/sstephenson/bats/master/libexec/bats-exec-suite @@ -398,6 +399,18 @@ bats: +# ------------------------------------------------------------------------ +# +# Developer +# +# target: scaff-reinstall - Reinstall using scaffolding processing scripts. +.PHONY: scaff-reinstall +scaff-reinstall: + @$(call HELPTEXT,$@) + #rm -rf -v !(composer.*|vendor|.anax); .anax/scaffold/postprocess.bash + + + # ------------------------------------------------------------------------ # # Theme @@ -406,61 +419,61 @@ bats: .PHONY: theme theme: @$(call HELPTEXT,$@) - [ ! -d theme ] || $(MAKE) --directory=theme build install - #[ ! -d theme ] || ( cd theme && make build install ) + [ ! -d theme ] || $(MAKE) --directory=theme build + rsync -a theme/build/less/css htdocs/ -# ------------------------------------------------------------------------ +# # ------------------------------------------------------------------------ +# # +# # Cimage +# # # -# Cimage +# define CIMAGE_CONFIG +# "development", +# "image_path" => __DIR__ . "/../img/", +# "cache_path" => __DIR__ . "/../../cache/cimage/", +# "autoloader" => __DIR__ . "/../../vendor/autoload.php", +# ]; +# endef +# export CIMAGE_CONFIG # - -define CIMAGE_CONFIG - "development", - "image_path" => __DIR__ . "/../img/", - "cache_path" => __DIR__ . "/../../cache/cimage/", - "autoloader" => __DIR__ . "/../../vendor/autoload.php", -]; -endef -export CIMAGE_CONFIG - -define GIT_IGNORE_FILES -# Ignore everything in this directory -* -# Except this file -!.gitignore -endef -export GIT_IGNORE_FILES - -# target: cimage-install - Install Cimage in htdocs -.PHONY: cimage-install -cimage-install: - @$(call HELPTEXT,$@) - install -d htdocs/img htdocs/cimage cache/cimage - chmod 777 cache/cimage - $(ECHO) "$$GIT_IGNORE_FILES" | bash -c 'cat > cache/cimage/.gitignore' - cp vendor/mos/cimage/webroot/img.php htdocs/cimage - cp vendor/mos/cimage/webroot/img/car.png htdocs/img/ - touch htdocs/cimage/img_config.php - -# target: cimage-update - Update Cimage to latest version. -.PHONY: cimage-update -cimage-update: - @$(call HELPTEXT,$@) - composer require mos/cimage - install -d htdocs/img htdocs/cimage cache/cimage - chmod 777 cache/cimage - $(ECHO) "$$GIT_IGNORE_FILES" | bash -c 'cat > cache/cimage/.gitignore' - cp vendor/mos/cimage/webroot/img.php htdocs/cimage - cp vendor/mos/cimage/webroot/img/car.png htdocs/img/ - touch htdocs/cimage/img_config.php - -# target: cimage-config-create - Create configfile for Cimage. -.PHONY: cimage-config-create -cimage-config-create: - @$(call HELPTEXT,$@) - $(ECHO) "$$CIMAGE_CONFIG" | bash -c 'cat > htdocs/cimage/img_config.php' - cat htdocs/cimage/img_config.php +# define GIT_IGNORE_FILES +# # Ignore everything in this directory +# * +# # Except this file +# !.gitignore +# endef +# export GIT_IGNORE_FILES +# +# # target: cimage-install - Install Cimage in htdocs +# .PHONY: cimage-install +# cimage-install: +# @$(call HELPTEXT,$@) +# install -d htdocs/img htdocs/cimage cache/cimage +# chmod 777 cache/cimage +# $(ECHO) "$$GIT_IGNORE_FILES" | bash -c 'cat > cache/cimage/.gitignore' +# cp vendor/mos/cimage/webroot/img.php htdocs/cimage +# cp vendor/mos/cimage/webroot/img/car.png htdocs/img/ +# touch htdocs/cimage/img_config.php +# +# # target: cimage-update - Update Cimage to latest version. +# .PHONY: cimage-update +# cimage-update: +# @$(call HELPTEXT,$@) +# composer require mos/cimage +# install -d htdocs/img htdocs/cimage cache/cimage +# chmod 777 cache/cimage +# $(ECHO) "$$GIT_IGNORE_FILES" | bash -c 'cat > cache/cimage/.gitignore' +# cp vendor/mos/cimage/webroot/img.php htdocs/cimage +# cp vendor/mos/cimage/webroot/img/car.png htdocs/img/ +# touch htdocs/cimage/img_config.php +# +# # target: cimage-config-create - Create configfile for Cimage. +# .PHONY: cimage-config-create +# cimage-config-create: +# @$(call HELPTEXT,$@) +# $(ECHO) "$$CIMAGE_CONFIG" | bash -c 'cat > htdocs/cimage/img_config.php' +# cat htdocs/cimage/img_config.php