|
| 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 | + |
0 commit comments