-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
33 lines (27 loc) · 1.32 KB
/
Makefile
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
# 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 = python
# .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
# Defining an array variable
TESTPATH = tests
TESTFILE = test_soda.py
# 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 "To build: make setup"
@echo "To test: make test"
# 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 $${}
setup:
@echo "Building local package"
pip install --upgrade -e ./
# The ${} notation is specific to the make syntax and is very similar to bash's $()
# This function uses pytest to test our source files
test:
${PYTHON} ${TESTPATH}/${TESTFILE}