-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
62 lines (48 loc) · 1.9 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
# Natural Language Toolkit: source Makefile
#
# Copyright (C) 2001-2014 NLTK Project
# Author: Steven Bird <[email protected]>
# Edward Loper <[email protected]>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
PYTHON = python
VERSION = $(shell $(PYTHON) -c 'import nltk; print(nltk.__version__)' | sed '/^Warning: */d')
NLTK_URL = $(shell $(PYTHON) -c 'import nltk; print(nltk.__url__)' | sed '/^Warning: */d')
.PHONY: all clean clean_code
all: dist
########################################################################
# TESTING
########################################################################
DOCTEST_DRIVER = nltk/test/doctest_driver.py
DOCTEST_FLAGS = --ellipsis --normalize_whitespace
DOCTEST_FILES = nltk/test/*.doctest
DOCTEST_CODE_FILES = nltk/*.py nltk/*/*.py
doctest:
$(PYTHON) $(DOCTEST_DRIVER) $(DOCTEST_FLAGS) $(DOCTEST_FILES)
doctest_code:
$(PYTHON) $(DOCTEST_DRIVER) $(DOCTEST_FLAGS) $(DOCTEST_CODE_FILES)
demotest:
find nltk -name "*.py"\
-and -not -path *misc* \
-and -not -name brown_ic.py \
-exec echo ==== '{}' ==== \; -exec python '{}' \;
########################################################################
# DISTRIBUTIONS
########################################################################
dist: zipdist gztardist windist
gztardist: clean_code
$(PYTHON) setup.py -q sdist --format=gztar
zipdist: clean_code
$(PYTHON) setup.py -q sdist --format=zip
windist: clean_code
$(PYTHON) setup.py -q bdist --format=wininst --plat-name=win32
########################################################################
# CLEAN
########################################################################
clean: clean_code
rm -rf build iso dist api MANIFEST nltk-$(VERSION) nltk.egg-info
clean_code:
rm -f `find nltk -name '*.pyc'`
rm -f `find nltk -name '*.pyo'`
rm -f `find . -name '*~'`
rm -f MANIFEST # regenerate manifest from MANIFEST.in