aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-01 10:45:02 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-01 10:45:02 -0200
commit2c49897d9d2c3c709ad7e7afdd976efab06a867b (patch)
treec589077df93a003670f162d2559f5a77bf30c425
parent3cc3e6f453decb41d521374adf6c5a8810a05dd3 (diff)
downloadtemplater-2c49897d9d2c3c709ad7e7afdd976efab06a867b.tar.gz
templater-2c49897d9d2c3c709ad7e7afdd976efab06a867b.tar.bz2
Makefile: support other web servers
-rw-r--r--share/templater/templater/files/Makefile12
1 files changed, 6 insertions, 6 deletions
diff --git a/share/templater/templater/files/Makefile b/share/templater/templater/files/Makefile
index fe75ca7..6dbbd98 100644
--- a/share/templater/templater/files/Makefile
+++ b/share/templater/templater/files/Makefile
@@ -6,7 +6,8 @@
#
# Port to serve content
-PORT="8000"
+HTTP_PORT="8000"
+HTTP_SERVER="SimpleHTTPServer"
# Set CONTAINER based in what we have available in the system
# This variable can be user in other, included Makefiles to handle virtualization tasks
@@ -23,11 +24,10 @@ endif
# 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 $(PORT)
- #python -m SimpleHTTPServer
- # Or the Python 3 equivalent
- #python3 -m http.server
- #php -S localhost:8000
+ @if [ "$(HTTP_SERVER)" = "SimpleHTTPServer" ]; then python -m SimpleHTTPServer $(HTTP_PORT); fi
+ @if [ "$(HTTP_SERVER)" = "ssi_server" ]; then PYTHONDONTWRITEBYTECODE=0 ssi_server.py $(HTTP_PORT); fi
+ @if [ "$(HTTP_SERVER)" = "http.server" ]; then python3 -m http.server $(HTTP_PORT); fi
+ @if [ "$(HTTP_SERVER)" = "php" ]; then php -S localhost:$(HTTP_PORT); fi
# Configure a git post-receive hook
post_receive: