Last active
March 21, 2018 00:41
-
-
Save tun/11375872 to your computer and use it in GitHub Desktop.
Makefile for python (version 2 or 3) http server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PYTHON_VERSION = python --version|awk '{print $2}'|cut -c -1 | |
ifeq ($PYTHON_VERSION,2) | |
PYHTTP = python -m 'SimpleHTTPServer' | |
else | |
PYHTTP = python -m http.server | |
endif | |
serve: | |
$(PYHTTP) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment