Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 3323e8f

Browse files
committed
Scripts replaced by Makefile
1 parent dc466d2 commit 3323e8f

File tree

6 files changed

+239
-10
lines changed

6 files changed

+239
-10
lines changed

Makefile

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
ifeq ($(OS),Windows_NT)
2+
PYTHON2_X86 = "c:\Program Files (x86)\Python27\python.exe"
3+
PYTHON3_X86 = "c:\Program Files (x86)\Python35\python.exe"
4+
PYTHON2_X64 = "c:\Program Files\Python27\python.exe"
5+
PYTHON3_X64 = "c:\Program Files\Python35\python.exe"
6+
else
7+
PYTHON2_X86 = /usr/bin/python2
8+
PYTHON3_X86 = /usr/bin/python3
9+
PYTHON2_X64 = /usr/bin/python2
10+
PYTHON3_X64 = /usr/bin/python3
11+
endif
12+
13+
.PHONY: all build upload test clean
14+
15+
all: build
16+
17+
ifeq ($(OS),Windows_NT)
18+
build: build_sdist \
19+
build_egg_py2_x86 \
20+
build_egg_py3_x86 \
21+
build_egg_py2_x64 \
22+
build_egg_py3_x64 \
23+
build_wheel_py2_x86 \
24+
build_wheel_py3_x86 \
25+
build_wheel_py2_x64 \
26+
build_wheel_py3_x64 \
27+
build_wininst_py2_x86 \
28+
build_wininst_py3_x86 \
29+
build_wininst_py2_x64 \
30+
build_wininst_py3_x64 \
31+
build_msi_py2_x86 \
32+
build_msi_py3_x86 \
33+
build_msi_py2_x64 \
34+
build_msi_py3_x64
35+
else
36+
build: build_sdist \
37+
build_egg_py2_x64 \
38+
build_egg_py3_x64 \
39+
build_wheel_py2_x64 \
40+
build_wheel_py3_x64
41+
endif
42+
43+
build_sdist: clean
44+
$(PYTHON2_X86) setup.py sdist --formats=zip,gztar,bztar
45+
46+
build_egg_py2_x86: clean
47+
# Workaround fix inclusion of python modules in the distribution
48+
$(PYTHON2_X86) setup.py bdist_egg build
49+
$(PYTHON2_X86) setup.py bdist_egg build
50+
51+
build_egg_py3_x86: clean
52+
$(PYTHON3_X86) setup.py bdist_egg build
53+
54+
build_egg_py2_x64: clean
55+
# Workaround fix inclusion of python modules in the distribution
56+
$(PYTHON2_X64) setup.py bdist_egg build
57+
$(PYTHON2_X64) setup.py bdist_egg build
58+
59+
build_egg_py3_x64: clean
60+
$(PYTHON3_X64) setup.py bdist_egg build
61+
62+
build_wheel_py2_x86: clean
63+
$(PYTHON2_X86) setup.py bdist_wheel build
64+
65+
build_wheel_py3_x86: clean
66+
$(PYTHON3_X86) setup.py bdist_wheel build
67+
68+
build_wheel_py2_x64: clean
69+
$(PYTHON2_X64) setup.py bdist_wheel build
70+
71+
build_wheel_py3_x64: clean
72+
$(PYTHON3_X64) setup.py bdist_wheel build
73+
74+
build_msi_py2_x86: clean
75+
$(PYTHON2_X86) setup.py bdist_msi build
76+
77+
build_msi_py3_x86: clean
78+
$(PYTHON3_X86) setup.py bdist_msi build
79+
80+
build_msi_py2_x64: clean
81+
$(PYTHON2_X64) setup.py bdist_msi build
82+
83+
build_msi_py3_x64: clean
84+
$(PYTHON3_X64) setup.py bdist_msi build
85+
86+
build_wininst_py2_x86: clean
87+
$(PYTHON2_X86) setup.py bdist_wininst build
88+
89+
build_wininst_py3_x86: clean
90+
$(PYTHON3_X86) setup.py bdist_wininst build
91+
92+
build_wininst_py2_x64: clean
93+
$(PYTHON2_X64) setup.py bdist_wininst build
94+
95+
build_wininst_py3_x64: clean
96+
$(PYTHON3_X64) setup.py bdist_wininst build
97+
98+
ifeq ($(OS),Windows_NT)
99+
upload: upload_sdist \
100+
upload_egg_py2_x86 \
101+
upload_egg_py3_x86 \
102+
upload_egg_py2_x64 \
103+
upload_egg_py3_x64 \
104+
upload_wheel_py2_x86 \
105+
upload_wheel_py3_x86 \
106+
upload_wheel_py2_x64 \
107+
upload_wheel_py3_x64 \
108+
upload_wininst_py2_x86 \
109+
upload_wininst_py3_x86 \
110+
upload_wininst_py2_x64 \
111+
upload_wininst_py3_x64 \
112+
upload_msi_py2_x86 \
113+
upload_msi_py3_x86 \
114+
upload_msi_py2_x64 \
115+
upload_msi_py3_x64
116+
else
117+
upload: build_sdist \
118+
upload_egg_py2_x64 \
119+
upload_egg_py3_x64 \
120+
upload_wheel_py2_x64 \
121+
upload_wheel_py3_x64
122+
endif
123+
124+
upload_sdist: clean
125+
$(PYTHON2_X86) setup.py sdist --formats=zip,gztar,bztar upload
126+
127+
upload_egg_py2_x86: clean
128+
# Workaround fix inclusion of python modules in the distribution
129+
$(PYTHON2_X86) setup.py bdist_egg build
130+
$(PYTHON2_X86) setup.py bdist_egg upload
131+
132+
upload_egg_py3_x86: clean
133+
$(PYTHON3_X86) setup.py bdist_egg upload
134+
135+
upload_egg_py2_x64: clean
136+
# Workaround fix inclusion of python modules in the distribution
137+
$(PYTHON2_X64) setup.py bdist_egg build
138+
$(PYTHON2_X64) setup.py bdist_egg upload
139+
140+
upload_egg_py3_x64: clean
141+
$(PYTHON3_X64) setup.py bdist_egg upload
142+
143+
upload_wheel_py2_x86: clean
144+
$(PYTHON2_X86) setup.py bdist_wheel upload
145+
146+
upload_wheel_py3_x86: clean
147+
$(PYTHON3_X86) setup.py bdist_wheel upload
148+
149+
upload_wheel_py2_x64: clean
150+
$(PYTHON2_X64) setup.py bdist_wheel upload
151+
152+
upload_wheel_py3_x64: clean
153+
$(PYTHON3_X64) setup.py bdist_wheel upload
154+
155+
upload_msi_py2_x86: clean
156+
$(PYTHON2_X86) setup.py bdist_msi upload
157+
158+
upload_msi_py3_x86: clean
159+
$(PYTHON3_X86) setup.py bdist_msi upload
160+
161+
upload_msi_py2_x64: clean
162+
$(PYTHON2_X64) setup.py bdist_msi upload
163+
164+
upload_msi_py3_x64: clean
165+
$(PYTHON3_X64) setup.py bdist_msi upload
166+
167+
upload_wininst_py2_x86: clean
168+
$(PYTHON2_X86) setup.py bdist_wininst upload
169+
170+
upload_wininst_py3_x86: clean
171+
$(PYTHON3_X86) setup.py bdist_wininst upload
172+
173+
upload_wininst_py2_x64: clean
174+
$(PYTHON2_X64) setup.py bdist_wininst upload
175+
176+
upload_wininst_py3_x64: clean
177+
$(PYTHON3_X64) setup.py bdist_wininst upload
178+
179+
ifeq ($(OS),Windows_NT)
180+
test: test_py2_x86 test_py2_x64 test_py3_x86 test_py3_x86
181+
else
182+
test: test_py2_x86 test_py2_x64
183+
endif
184+
185+
test_py2_x86: clean
186+
$(PYTHON2_X86) setup.py test
187+
188+
test_py3_x86: clean
189+
$(PYTHON3_X86) setup.py test
190+
191+
test_py2_x64: clean
192+
$(PYTHON2_X64) setup.py test
193+
194+
test_py3_x64: clean
195+
$(PYTHON3_X64) setup.py test
196+
197+
clean:
198+
rm -rf build *.egg-info tests/*.{htk,lat}
199+
rm -rf sphinxbase/sphinxbase.py
200+
rm -rf pocketsphinx/pocketsphinx.py
201+
rm -rf {sphinxbase,pocketsphinx}/*.{so,pyd}
202+
rm -rf {sphinxbase,pocketsphinx,tests}/*.pyc
203+
rm -rf {sphinxbase,pocketsphinx,tests}/__pycache__
204+
rm -rf pocketsphinx/{data,model}
205+
rm -rf swig/sphinxbase/*.c
206+
rm -rf deps/{sphinxbase,pocketsphinx}/swig/*.c
207+

scripts/build.bat

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@ rmdir /s /q dist
99

1010
call scripts\clean.bat
1111
%python27_x86% setup.py sdist --formats=zip,gztar,bztar
12-
%python27_x86% setup.py sdist --formats=zip,gztar,bztar
12+
1313
call scripts\clean.bat
1414
%python27_x86% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
1515
%python27_x86% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
16+
1617
call scripts\clean.bat
1718
%python27_x64% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
1819
%python27_x64% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
20+
1921
call scripts\clean.bat
2022
%python35_x86% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
2123
%python35_x86% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
24+
2225
call scripts\clean.bat
2326
%python35_x64% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
2427
%python35_x64% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build

scripts/build.sh

100644100755
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#!/usr/bin/env bash
2-
rm -rf build dist *.egg-info tests/*.{htk,lat}
3-
rm -rf sphinxbase/{sphinxbase,pocketsphinx}.py {sphinxbase,pocketsphinx}/*.so
4-
rm -rf pocketsphinx/{data,model}
52

6-
python setup.py sdist --formats=zip,gztar,bztar build
3+
rm -rf dist
4+
5+
scripts/clean.sh
6+
python setup.py sdist --formats=zip,gztar,bztar
7+
8+
scripts/clean.sh
9+
python2 setup.py bdist_egg build
710
python2 setup.py bdist_egg build
11+
12+
scripts/clean.sh
13+
python3 setup.py bdist_egg bdist_wheel build
814
python3 setup.py bdist_egg bdist_wheel build

scripts/clean.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
rm -rf build *.egg-info tests/*.{htk,lat}
3+
rm -rf sphinxbase/{sphinxbase,pocketsphinx}.py {sphinxbase,pocketsphinx}/*.so
4+
rm -rf pocketsphinx/{data,model}

scripts/upload.bat

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@ set python35_x86="c:\Program Files (x86)\Python35\python.exe"
88
rmdir /s /q dist
99

1010
call scripts\clean.bat
11-
%python27_x86% setup.py sdist --formats=zip,gztar,bztar
1211
%python27_x86% setup.py sdist --formats=zip,gztar,bztar upload
12+
1313
call scripts\clean.bat
1414
%python27_x86% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
1515
%python27_x86% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel upload
16+
1617
call scripts\clean.bat
1718
%python27_x64% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
1819
%python27_x64% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel upload
20+
1921
call scripts\clean.bat
2022
%python35_x86% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
2123
%python35_x86% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel upload
24+
2225
call scripts\clean.bat
2326
%python35_x64% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel build
2427
%python35_x64% setup.py bdist_egg bdist_wininst bdist_msi bdist_wheel upload

scripts/upload.sh

100644100755
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#!/usr/bin/env bash
2-
rm -rf build dist *.egg-info tests/*.{htk,lat}
3-
rm -rf sphinxbase/{sphinxbase,pocketsphinx}.py {sphinxbase,pocketsphinx}/*.so
4-
rm -rf pocketsphinx/{data,model}
52

6-
python setup.py sdist --formats=zip,gztar,bztar build
3+
rm -rf dist
4+
5+
scrips/clean.sh
6+
python setup.py sdist --formats=zip,gztar,bztar upload
7+
8+
scrips/clean.sh
79
python2 setup.py bdist_egg build
10+
python2 setup.py bdist_egg upload
11+
12+
scrips/clean.sh
813
python3 setup.py bdist_egg bdist_wheel build
14+
python3 setup.py bdist_egg bdist_wheel upload

0 commit comments

Comments
 (0)