Skip to content

Commit

Permalink
Update Makefile to latest from anax/commons.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosbth committed Apr 23, 2020
1 parent cce3659 commit 728f1fc
Showing 1 changed file with 69 additions and 56 deletions.
125 changes: 69 additions & 56 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
# <?php
# return [
# "mode" => "development",
# "image_path" => __DIR__ . "/../img/",
# "cache_path" => __DIR__ . "/../../cache/cimage/",
# "autoloader" => __DIR__ . "/../../vendor/autoload.php",
# ];
# endef
# export CIMAGE_CONFIG
#

define CIMAGE_CONFIG
<?php
return [
"mode" => "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

0 comments on commit 728f1fc

Please sign in to comment.