| 1 |
# Natural Language Toolkit: source Makefile |
| 2 |
# |
| 3 |
# Copyright (C) 2001-2026 NLTK Project |
| 4 |
# Author: Steven Bird <[email protected]> |
| 5 |
# Edward Loper <[email protected]> |
| 6 |
# URL: <https://www.nltk.org/> |
| 7 |
# For license information, see LICENSE.TXT |
| 8 |
|
| 9 |
PYTHON = python |
| 10 |
VERSION = $(shell $(PYTHON) -c 'import nltk; print(nltk.__version__)' | sed '/^Warning: */d') |
| 11 |
NLTK_URL = $(shell $(PYTHON) -c 'import nltk; print(nltk.__url__)' | sed '/^Warning: */d') |
| 12 |
|
| 13 |
.PHONY: all clean clean_code |
| 14 |
|
| 15 |
all: dist |
| 16 |
|
| 17 |
######################################################################## |
| 18 |
# TESTING |
| 19 |
######################################################################## |
| 20 |
DOCTEST_FILES = nltk/test/*.doctest |
| 21 |
DOCTEST_CODE_FILES = nltk/*.py nltk/*/*.py |
| 22 |
|
| 23 |
doctest: |
| 24 |
pytest $(DOCTEST_FILES) |
| 25 |
|
| 26 |
doctest_code: |
| 27 |
pytest $(DOCTEST_CODE_FILES) |
| 28 |
|
| 29 |
demotest: |
| 30 |
find nltk -name "*.py"\ |
| 31 |
-and -not -path *misc* \ |
| 32 |
-and -not -name brown_ic.py \ |
| 33 |
-exec echo ==== '{}' ==== \; -exec python '{}' \; |
| 34 |
|
| 35 |
######################################################################## |
| 36 |
# DISTRIBUTIONS |
| 37 |
######################################################################## |
| 38 |
|
| 39 |
dist: clean_code |
| 40 |
$(PYTHON) -m build |
| 41 |
|
| 42 |
######################################################################## |
| 43 |
# CLEAN |
| 44 |
######################################################################## |
| 45 |
|
| 46 |
clean: clean_code |
| 47 |
rm -rf build web/_build iso dist api MANIFEST nltk-$(VERSION) nltk.egg-info |
| 48 |
|
| 49 |
clean_code: |
| 50 |
rm -f `find nltk -name '*.pyc'` |
| 51 |
rm -f `find nltk -name '*.pyo'` |
| 52 |
rm -f `find . -name '*~'` |
| 53 |
rm -rf `find . -name '__pycache__'` |
| 54 |
rm -f MANIFEST # regenerate manifest from MANIFEST.in |