I have a Python project and now I am trying to create a Makefile
that should run specific commands, such as apt-get
, and access variable values that are passed to make commands as arguments. Below is my Makefile
code:
VENV = venvs
PYTHON = $(VENV)/bin/python3
PIP = $(VENV)/bin/pip
run : $(VENV)/bin/activate
$(PYTHON) jobs/first_file.py
$(VENV)/bin/activate:
docker run -it python:3.8-buster /bin/bash
python3 -m venv $(VENV)
$(PIP) install --upgrade pip
$(PIP) install -r requirements.txt
clean :
rm -rf __pycache__
rm -rf $(VENV)
Now, my intention is to invoke the docker image and run the pip commands
and later on all the further commands on that docker image. It also includes connecting to an AWS account whose values would be passed in the make command as arguments.
But when I run make in the project's root directory. It just connects to the docker bash and does nothing. What exactly am I missing here?