-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
27 lines (23 loc) · 928 Bytes
/
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
PYTHON ?= /usr/bin/env python
PROJECT_NAME_BIN ?= ansible-lookups
PROJECT_NAME_SRC ?= lookups
clean:
@ echo "[INFO] Cleaning directory:" $(shell pwd)/.local-ci
@ rm -rf $(shell pwd)/.local-ci
@ echo "[INFO] Cleaning directory:" $(shell pwd)/target
@ rm -rf $(shell pwd)/target
@ echo "[INFO] Cleaning files: *.pyc"
@ find . -name "*.pyc" -delete
@ echo "[INFO] Cleaning files: .coverage"
@ rm -rf $(shell pwd)/.coverage
compile: clean
@ echo "[INFO] Compiling to binary, $(PROJECT_NAME_BIN)"
@ mkdir -p $(shell pwd)/target
@ cd $(shell pwd)/src/; zip --quiet -r ../target/$(PROJECT_NAME_BIN) *
@ echo '#!$(PYTHON)' > target/$(PROJECT_NAME_BIN) && \
cat target/$(PROJECT_NAME_BIN).zip >> target/$(PROJECT_NAME_BIN) && \
rm target/$(PROJECT_NAME_BIN).zip && \
chmod a+x target/$(PROJECT_NAME_BIN)
test: clean
@ echo "[INFO] Testing ..."
@ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(shell pwd)/src/ test-suites