-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (38 loc) · 1.73 KB
/
Makefile
File metadata and controls
46 lines (38 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Signifies our desired python version
# Makefile macros (or variables) are defined a little bit differently than traditional bash, keep in mind that in the Makefile there's top-level Makefile-only syntax, and everything else is bash script syntax.
PYTHON = python3
# .PHONY defines parts of the makefile that are not dependant on any specific file
# This is most often used to store functions
#.PHONY = help setup test run clean
# Defines the default target that `make` will to try to make, or in the case of a phony target, execute the specified commands
# This target is executed whenever we just type `make`
.DEFAULT_GOAL = help
# The @ makes sure that the command itself isn't echoed in the terminal
help:
@echo "---------------HELP-----------------"
@echo "To setup the project type make setup"
@echo "To test the project type make test"
@echo "To run the project type make run"
@echo "------------------------------------"
# This generates the desired project file structure
# A very important thing to note is that macros (or makefile variables) are referenced in the target's code with a single dollar sign ${}, but all script variables are referenced with two dollar signs $${}
runKMeans:
. venv/bin/activate;
python3 kmeans.py
setup:
@echo "Checking if project files are generated..."
[ -d project_files.project ] || (echo "No directory found, generating..." && mkdir project_files.project)
for FILE in ${FILES}; do \
touch "project_files.project/$${FILE}.txt"; \
done
install: venv
( \
. venv/bin/activate; \
pip3 install -Ur requirements.txt; \
)
venv:
test -d venv || python3 -m venv venv
# This is a rule to delete our virtual environment as well as the compiled python bytecode"
clean:
rm -rf venv
find -iname "*.pyc" -delete