forked from amccaugh/phidl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (52 loc) · 2.04 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
SHELL := /usr/bin/env bash
# Makefile has convenience targets for
# 1. Creating virtual environment which has the source version of phidl installed
# 2. Linking phidl user-wide to this source
# 2. Making documentation
# 3. Running tests
# The environment is important if you have a stable version of phidl elsewhere and still want to develop on this source
# Instead of a virtual environment, you can create a user-wide dynamic link to the source by running
# `make dynamic-install`
# DOCTYPE_DEFAULT can be html or latexpdf
DOCTYPE_DEFAULT = html
# General dependencies for devbuild, docbuild
REINSTALL_DEPS = $(shell find phidl -type f) venv setup.py
venv: venv/bin/activate
venv/bin/activate:
test -d venv || virtualenv -p python3 --prompt "(phidl-venv) " --distribute venv
touch venv/bin/activate
clean:
rm -rf dist
rm -rf phidl.egg-info
rm -rf build
rm -rf venvinfo
$(MAKE) -C docs clean
purge: clean
rm -rf venv
# Does not go in virtualenv. Changes phidl installation user-wide
dynamic-install:
pip uninstall phidl
pip install -e .
docbuild: venvinfo/docreqs~
venvinfo/docreqs~: $(REINSTALL_DEPS) doc-requirements.txt
( \
source venv/bin/activate; \
pip install -r doc-requirements.txt | grep -v 'Requirement already satisfied'; \
pip install -e . | grep -v 'Requirement already satisfied'; \
)
@mkdir -p venvinfo
@touch venvinfo/docreqs~
docs: docbuild
source venv/bin/activate; $(MAKE) -C docs $(DOCTYPE_DEFAULT)
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo "--- environment ---"
@echo " venv creates a python virtualenv in venv/"
@echo " clean clean all build files"
@echo " purge clean and delete virtual environment"
@echo " dynamic-install have pip dynamically link phidl to this source code, everywhere on your computer"
@echo "--- testing ---"
@echo "--- documentation ---"
@echo " docbuild install doc dependencies, rebuild phidl, and install in venv"
@echo " docs build documentation"
.PHONY: help docs clean purge dynamic-install