diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2021-01-28 15:50:11 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2021-01-28 15:50:11 -0300 |
commit | 2b343942870441b1c0f83cc6afdb030056d45c2e (patch) | |
tree | 8773f01a5f8d1cf711e7bcf91f915ba47991b493 /Makefile | |
parent | 8f381d2dd5af97f3663449a5ffc7ed76d11976fd (diff) | |
download | csv-hasher-2b343942870441b1c0f83cc6afdb030056d45c2e.tar.gz csv-hasher-2b343942870441b1c0f83cc6afdb030056d45c2e.tar.bz2 |
Feat: initial version
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 55 |
1 files changed, 13 insertions, 42 deletions
@@ -1,50 +1,21 @@ # -# Global Makefile - https://templater.fluxo.info +# Makefile for csv-hasher # -# This Makefile contains basic, common targets and also includes -# any Makefile.* available in the current folder. -# - -# Port to serve content -HTTP_PORT="8000" -HTTP_SERVER="http.server" -# Base to serve the content -HTTP_BASE="." +vendor: + pipenv install -# Set CONTAINER based in what we have available in the system -# This variable can be user in other, included Makefiles to handle virtualization tasks -ifeq ($(shell which kvmx > /dev/null && test -s kvmxfile && echo yes), yes) - CONTAINER = kvmx -else ifeq ($(shell which vagrant > /dev/null && test -s Vagrantfile && echo yes), yes) - CONTAINER = vagrant -else ifeq ($(shell which docker > /dev/null && test -s Dockerfile && echo yes), yes) - CONTAINER = docker -else - CONTAINER = '' -endif +sample: + bin/make-sample 200 -# See http://unix.stackexchange.com/questions/32182/simple-command-line-http-server#32200 -# http://php.net/manual/en/features.commandline.webserver.php -serve: - @if [ "$(HTTP_SERVER)" = "SimpleHTTPServer" ]; then cd $(HTTP_BASE) && python -m SimpleHTTPServer $(HTTP_PORT); fi - @if [ "$(HTTP_SERVER)" = "ssi_server" ]; then cd $(HTTP_BASE) && PYTHONDONTWRITEBYTECODE=0 ssi_server.py $(HTTP_PORT); fi - @if [ "$(HTTP_SERVER)" = "http.server" ]; then cd $(HTTP_BASE) && python3 -m http.server $(HTTP_PORT); fi - @if [ "$(HTTP_SERVER)" = "php" ]; then cd $(HTTP_BASE) && php -S localhost:$(HTTP_PORT); fi +test-sample: + pipenv run ./csv-hasher.py --chunksize 5 tests/sample.csv tests/output.csv id -# Configure a git post-receive hook -post_receive: - git config receive.denyCurrentBranch ignore - test -s bin/post-receive && cd .git/hooks && ln -sf ../../bin/post-receive +show-test-output: + head -20 tests/sample.csv + head -20 tests/output.csv -# Process any other Makefile whose filename matches Makefile.* -# See https://www.gnu.org/software/make/manual/html_node/Include.html -# -# Some of those files might even contain local customizations/overrides -# that can be .gitignore'd, like a Makefile.local for example. --include Makefile.* +clean-sample: + rm tests/*.csv -# Customization examples can be as simple as setting variables: -#CONTAINER = vagrant -#CONTAINER = docker -#DESTDIR ?= vendor +test: clean-sample sample test-sample show-test-output clean-sample |