~kevang/mnemosyne-proj/grade-shortcuts-improvements

« back to all changes in this revision

Viewing changes to mnemosyne/makefile

  • Committer: Peter Bienstman
  • Date: 2013-05-31 18:47:16 UTC
  • Revision ID: peter.bienstman@ugent.be-20130531184716-iqo7kqwdjohj50pa
More server tweaks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
endif
11
11
# If we are on cygwin:
12
12
ifeq (1,$(shell /cygdrive/c/Python27/python.exe -c "print(1)" 2>&- ))
13
 
  PYTHON      := /cygdrive/c/Python27/python.exe
 
13
  PYTHON      := cygstart /cygdrive/c/Python27/python.exe
14
14
endif
15
15
# If `virtualenv2` exists:
16
16
ifneq (,$(shell virtualenv2 --version 2>&- ))
27
27
 
28
28
export PYTHON  # pass the variable to sub-makefiles through the environment
29
29
 
 
30
 
30
31
# Allow specifying an alternate root destination dir for system-wide installation:
31
32
 
32
33
ifdef DESTDIR
33
34
  INSTALL_OPTS += --root="$(DESTDIR)"
34
35
endif
35
36
 
 
37
 
36
38
install-and-run-virtual-env: install-virtual-env
37
39
        ./bin/mnemosyne -d dot_mnemosyne2
38
40
 
49
51
 
50
52
setup-windows:
51
53
        virtualenv --system-site-packages --python=C:/python27/python.exe .
52
 
        cp C:/python27/mplayer.exe Scripts/
53
 
        cp C:/python27/qt.conf Scripts/
54
 
        Scripts/easy_install.exe nose
55
 
        Scripts/easy_install.exe coverage
56
 
                             
 
54
        Scripts\easy_install.exe nose
 
55
        Scripts\easy_install.exe coverage
 
56
 
57
57
install-virtual-env-windows:
58
 
        cd mnemosyne/pyqt_ui && make
59
 
        cd mnemosyne/pyqt_ui && pyrcc4 -o mnemosyne_rc.py mnemosyne.qrc
60
 
        Scripts/python.exe setup.py develop
 
58
        Scripts\python.exe setup.py develop
 
59
        Scripts\python.exe Scripts\mnemosyne -d dot_mnemosyne2
61
60
 
62
61
install-system:
63
62
        # Also rebuilds the docs and the translations.
69
68
        cd po && make
70
69
        $(PYTHON) setup.py install $(INSTALL_OPTS)
71
70
        rm -f -R build
72
 
        
73
 
build-all-deps:
74
 
        # Also rebuilds the docs and the translations.
75
 
        cd mnemosyne/libmnemosyne/docs && make SPHINXBUILD=$(SPHINXBUILD) html
76
 
        # cd mnemosyne/pyqt_ui && make clean
77
 
        cd mnemosyne/pyqt_ui && make
78
 
        cd mnemosyne/pyqt_ui && pyrcc4 -o mnemosyne_rc.py mnemosyne.qrc
79
 
        cd po && make update
80
 
        cd po && make
81
71
 
82
72
test: install-virtual-env
83
73
        ./bin/nosetests tests
84
 
        
85
 
test-windows:
86
 
        Scripts/nosetests.exe tests
87
 
        
 
74
 
88
75
coverage: install-virtual-env
89
76
        rm -rf .coverage cover htmlcov
90
77
        ./bin/nosetests --with-coverage --cover-erase \
91
 
        --cover-package=mnemosyne.libmnemosyne,openSM2sync || (echo "testsuite failed")
 
78
        --cover-package=mnemosyne.libmnemosyne,openSM2sync
92
79
        ./bin/coverage html
93
80
        google-chrome htmlcov/index.html
94
 
        
95
 
coverage-windows: install-virtual-env-windows
96
 
        rm -rf .coverage cover htmlcov
97
 
        Scripts/nosetests --with-coverage --cover-erase \
98
 
        --cover-package=mnemosyne.libmnemosyne,openSM2sync || (echo "testsuite failed")
99
 
        Scripts/coverage html
100
 
        google-chrome htmlcov/index.html
101
 
        
 
81
 
102
82
profile: install-virtual-env
103
83
        echo "from hotshot import stats" > process_profile.py
104
84
        echo "s = stats.load(\"stats.dat\")" >> process_profile.py
150
130
        sudo cp -R /opt/local/share/qt4/plugins/imageformats/libqjpeg.dylib dist/Mnemosyne.app/Contents/plugins/imageformats/libqjpeg.dylib
151
131
        sudo install_name_tool -change /opt/local/lib/libQtGui.4.dylib @executable_path/../Frameworks/libQtGui.4.dylib dist/Mnemosyne.app/Contents/plugins/imageformats/libqjpeg.dylib
152
132
        sudo install_name_tool -change /opt/local/lib/libQtCore.4.dylib @executable_path/../Frameworks/libQtCore.4.dylib dist/Mnemosyne.app/Contents/plugins/imageformats/libqjpeg.dylib
153
 
        sudo cp /opt/local/lib/libjpeg.dylib dist/Mnemosyne.app/Contents/Frameworks/libjpeg.dylib
154
 
        sudo install_name_tool -change /opt/local/lib/libjpeg.dylib @executable_path/../Frameworks/libjpeg.dylib dist/Mnemosyne.app/Contents/plugins/imageformats/libqjpeg.dylib
155
 
        sudo install_name_tool -change /opt/local/lib/libjpeg.dylib @executable_path/../Frameworks/libjpeg.dylib dist/Mnemosyne.app/Contents/Frameworks/libjpeg.dylib
 
133
        sudo cp /opt/local/lib/libjpeg.8.dylib dist/Mnemosyne.app/Contents/Frameworks/libjpeg.8.dylib
 
134
        sudo install_name_tool -change /opt/local/lib/libjpeg.8.dylib @executable_path/../Frameworks/libjpeg.8.dylib dist/Mnemosyne.app/Contents/plugins/imageformats/libqjpeg.dylib
 
135
        sudo install_name_tool -change /opt/local/lib/libjpeg.8.dylib @executable_path/../Frameworks/libjpeg.8.dylib dist/Mnemosyne.app/Contents/Frameworks/libjpeg.8.dylib
156
136
        # add TIFF support
157
137
        sudo cp -R /opt/local/share/qt4/plugins/imageformats/libqtiff.dylib dist/Mnemosyne.app/Contents/plugins/imageformats/libqtiff.dylib
158
138
        sudo install_name_tool -change /opt/local/lib/libQtGui.4.dylib @executable_path/../Frameworks/libQtGui.4.dylib dist/Mnemosyne.app/Contents/plugins/imageformats/libqtiff.dylib
159
139
        sudo install_name_tool -change /opt/local/lib/libQtCore.4.dylib @executable_path/../Frameworks/libQtCore.4.dylib dist/Mnemosyne.app/Contents/plugins/imageformats/libqtiff.dylib
160
 
        sudo cp /opt/local/lib/libtiff.dylib dist/Mnemosyne.app/Contents/Frameworks/libtiff.dylib
161
 
        sudo install_name_tool -change /opt/local/lib/libtiff.dylib @executable_path/../Frameworks/libtiff.dylib dist/Mnemosyne.app/Contents/Frameworks/libtiff.dylib
 
140
        sudo cp /opt/local/lib/libtiff.3.dylib dist/Mnemosyne.app/Contents/Frameworks/libtiff.3.dylib
 
141
        sudo install_name_tool -change /opt/local/lib/libtiff.3.dylib @executable_path/../Frameworks/libtiff.3.dylib dist/Mnemosyne.app/Contents/Frameworks/libtiff.3.dylib
162
142
        sudo cp /opt/local/lib/libz.1.dylib dist/Mnemosyne.app/Contents/Frameworks/libz.1.dylib
163
 
        sudo install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib dist/Mnemosyne.app/Contents/Frameworks/libtiff.dylib
164
 
        sudo install_name_tool -change /opt/local/lib/libjpeg.dylib @executable_path/../Frameworks/libjpeg.dylib dist/Mnemosyne.app/Contents/Frameworks/libtiff.dylib
 
143
        sudo install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib dist/Mnemosyne.app/Contents/Frameworks/libtiff.3.dylib
 
144
        sudo install_name_tool -change /opt/local/lib/libjpeg.8.dylib @executable_path/../Frameworks/libjpeg.8.dylib dist/Mnemosyne.app/Contents/Frameworks/libtiff.3.dylib
 
145
 
165
146
 
166
147
wm: install-virtual-env
167
148
        cp mnemosyne/ppygui_ui/ppygui_ui/*.py mnemosyne/ppygui_ui/
169
150
 
170
151
docs:
171
152
        cd mnemosyne/libmnemosyne/docs && make html
172
 
        
173
 
android: # Creats the assets file with the Python code.
174
 
        rm -f mnemosyne/android/mnemosyne/assets/mnemosyne.zip
175
 
        #python -m compileall mnemosyne
176
 
        zip     -r mnemosyne/android/mnemosyne/assets/mnemosyne.zip openSM2sync -i \*.py
177
 
        zip -r mnemosyne/android/mnemosyne/assets/mnemosyne.zip mnemosyne/libmnemosyne -i \*.py
178
 
        zip     -r mnemosyne/android/mnemosyne/assets/mnemosyne.zip mnemosyne/cle -i \*.py
179
 
        zip     mnemosyne/android/mnemosyne/assets/mnemosyne.zip mnemosyne/version.py mnemosyne/__init__.py     
180
 
        
181
 
windows-installer:
 
153
 
 
154
windows:
182
155
        rm -rf dist
183
156
        rm -rf build
184
157
        cd mnemosyne/pyqt_ui && make clean
186
159
        cd mnemosyne/pyqt_ui && pyrcc4 -o mnemosyne_rc.py mnemosyne.qrc
187
160
        cd po && make
188
161
        $(PYTHON) setup.py py2exe
189
 
        read -p "Press any key when InnoSetup has finished..."
190
 
        V=`$(PYTHON) mnemosyne/version.py` && cp dist/Output/setup.exe mnemosyne-$${V}-setup.exe
191
162
 
192
163
clean:
193
164
        rm -f *~ *.pyc *.tgz process_profile.py
204
175
        cd po && make
205
176
        cd mnemosyne/libmnemosyne/docs && make html
206
177
        cd mnemosyne/pyqt_ui && make
207
 
        $(PYTHON) setup.py sdist --formats=gztar
 
178
        ./bin/python setup.py sdist
208
179
 
209
180
distrib-WM: FORCE
210
181
        # Windows Mobile.