Makefile 1.05 KB
Newer Older
chrissi^'s avatar
chrissi^ committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
PYTHON=python3
PYTHON_VENV=env

PROJECT_ROOT=.
WEBSERVER_PORT=8080
WEBSERVER_HOST=localhost

FLAMINGO_OUTPUT=output
FLAMINGO_ARGS=-p $(PROJECT_ROOT)
FLAMINGO_SERVER_ARGS=$(FLAMINGO_ARGS) --port=$(WEBSERVER_PORT) --host=$(WEBSERVER_HOST)


all: server

# setup / clean ###############################################################
$(PYTHON_VENV)/.created:
	rm -rf $(PYTHON_VENV) && \
	$(PYTHON) -m venv $(PYTHON_VENV) && \
	. $(PYTHON_VENV)/bin/activate && \
20
	pip install -r ./REQUIREMENTS-deploy.txt > $(PYTHON_VENV)/build.log 2>&1 && \
chrissi^'s avatar
chrissi^ committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
	(date > $(PYTHON_VENV)/.created) || \
	(echo "\e[31m"; cat $(PYTHON_VENV)/build.log; echo "\e[0m"; exit 1)

env: $(PYTHON_VENV)/.created

clean:
	rm -rf $(FLAMINGO_OUTPUT)

distclean:
	rm -rf $(PYTHON_VENV)


# build #######################################################################
html: env
	. $(PYTHON_VENV)/bin/activate && \
	flamingo build $(FLAMINGO_ARGS)

server: env
	. $(PYTHON_VENV)/bin/activate && \
	flamingo server $(FLAMINGO_SERVER_ARGS)

shell: env
	. $(PYTHON_VENV)/bin/activate && \
	flamingo shell $(FLAMINGO_ARGS)