diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-11-17 10:13:55 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-11-17 10:13:55 -0200 |
commit | 2da1b4416c5a8fca5db31e20657c182b8a59376b (patch) | |
tree | 6b9c1215119caedd1bd51cd421da647ab9036d56 /share/templater/templater | |
parent | bfa39cbb7f27181980a408a3d9e691cc4f1623c0 (diff) | |
download | templater-2da1b4416c5a8fca5db31e20657c182b8a59376b.tar.gz templater-2da1b4416c5a8fca5db31e20657c182b8a59376b.tar.bz2 |
Global Makefile
Diffstat (limited to 'share/templater/templater')
-rw-r--r-- | share/templater/templater/files/Makefile | 18 | ||||
-rw-r--r-- | share/templater/templater/functions | 23 |
2 files changed, 41 insertions, 0 deletions
diff --git a/share/templater/templater/files/Makefile b/share/templater/templater/files/Makefile new file mode 100644 index 0000000..a53fcbb --- /dev/null +++ b/share/templater/templater/files/Makefile @@ -0,0 +1,18 @@ +# +# Global Makefile - https://templater.fluxo.info +# +# This Makefile contains basic, common targets and also includes +# any Makefile.* available in the current folder. +# + +# See http://unix.stackexchange.com/questions/32182/simple-command-line-http-server#32200 +# http://php.net/manual/en/features.commandline.webserver.php +serve: + python -m SimpleHTTPServer + # Or the Python 3 equivalent + #python3 -m http.server + #php -S localhost:8000 + +# Process any other Makefile whose filename matches Makefile.* +# See https://www.gnu.org/software/make/manual/html_node/Include.html +-include Makefile.* diff --git a/share/templater/templater/functions b/share/templater/templater/functions index af6be08..47c240b 100644 --- a/share/templater/templater/functions +++ b/share/templater/templater/functions @@ -81,3 +81,26 @@ function __templater_user_input { fi } +# Install the global Makefile +function __templater_install_makefile { + if [ -z "$1" ]; then + return + fi + + local src="$1" + local name="`basename $src`" + + # First ensure we have the main Makefile + if [ ! -e "Makefile" ]; then + cp $SHARE/templater/files/Makefile . + fi + + # Then copy the custom Makefile + if [ ! -e "$name" ]; then + cp $src . + fi + + #if ! grep -q "^Makefile.local" .gitignore; then + # echo Makefile.local >> .gitignore + #fi +} |