# this can do multipage #go5: # dot -Tps server.dot > server.ps # evince server.ps #backshift_filesystem.py #fses.py #hardlinks.py #test_backshift_filesystem.py modules=varblock_mod.py pylint_files= \ backshift \ backshift_file_mod.py \ base255.py \ bufsock.py \ cacher_mod.py \ dohdbm.py \ escape_mod.py \ main.py \ metadata_mod.py \ path_mod.py \ py_treap_node.py \ py_treap.py \ readline0.py \ repo_mod.py \ rolling_checksum_py_mod.py \ saveset_mod.py \ # file_repo_mod.py \ # These are all files with things that pylint hates, even with the weird workarounds I've tried - keep'em small! # Why? Mostly because of the module renames from Python 2.x to 3.x no_pylint_files=treap.py python2x3.py stringio.py db_mod.py rolling_checksum_mod.py all_files=$(pylint_files)$(no_pylint_files) first-rule: prep unit-tests system-tests /bin/true prep: treap.py rolling_checksum_py_mod.py tags /bin/true treap.py py_treap.py py_treap_node.py: treap/m4_treap.m4 cd treap; make py_treap.py py_treap_node.py; cp treap.py py_treap.py py_treap_node.py .. unit-tests: test-rolling_checksum_py_mod.uto test-cacher_mod.uto test-escape_mod.2.5.uto test-escape_mod.3.2.uto /bin/true pick: ./this-pylint pick-rolling_checksum ./pick-rolling_checksum tags: $(all_files) ctags-exuberant $(all_files) system-tests: $(all_files) ./this-pylint $(pylint_files) cd tests; make rcm-input-data: if ! [ -f rcm-input-data ]; then dd if=/dev/urandom of=rcm-input-data bs=1024k count=32; fi test-rolling_checksum_py_mod.uto: rcm-input-data test-rolling_checksum_mod rolling_checksum_py_mod.py ./this-pylint test-rolling_checksum_mod rolling_checksum_py_mod.py bash -c 'set -o pipefail; ./this-pypy test-rolling_checksum_mod py 2>&1 3>&2 | tee test-rolling_checksum_py_mod.uto' test-rolling_checksum_pyx_mod.2.uto: rcm-input-data test-rolling_checksum_mod rolling_checksum_py_mod.py ./this-pylint test-rolling_checksum_mod rolling_checksum_py_mod.py bash -c 'set -o pipefail; /usr/local/cpython-2.7/bin/python test-rolling_checksum_mod pyx 2>&1 3>&2 | tee test-rolling_checksum_pyx_mod.2.uto' test-rolling_checksum_pyx_mod.3.uto: rcm-input-data test-rolling_checksum_mod rolling_checksum_py_mod.py ./this-pylint test-rolling_checksum_mod rolling_checksum_py_mod.py bash -c 'set -o pipefail; /usr/local/cpython-3.2/bin/python test-rolling_checksum_mod pyx 2>&1 3>&2 | tee test-rolling_checksum_pyx_mod.3.uto' test-cacher_mod.uto: test-cacher_mod cacher_mod.py ./this-pylint test-cacher_mod cacher_mod.py ./run-ut cacher_mod rm -f *.doh test-escape_mod.2.5.uto: test-escape_mod escape_mod.py ./this-pylint test-escape_mod escape_mod.py if ! /usr/local/cpython-2.5/bin/python test-escape_mod > test-escape_mod.2.5.uto 2>&1; then cat test-escape_mod.2.5.uto; exit 1; fi test-escape_mod.3.2.uto: test-escape_mod escape_mod.py ./this-pylint test-escape_mod escape_mod.py if ! /usr/local/cpython-3.2/bin/python test-escape_mod > test-escape_mod.3.2.uto 2>&1; then cat test-escape_mod.3.2.uto; exit 1; fi rcms: test-rolling_checksum_py_mod.uto rolling_checksum_pyx_mod.pyx #gcc -O3 -c -I/usr/local/cpython-$$pyvers/include/python$$pyvers rolling_checksum_pyx_mod.c; \ #gcc -shared rolling_checksum_pyx_mod.o -o rolling_checksum_pyx_mod.so; \ # set -xeu; \ for pyvers in 2.5 2.6 2.7 3.1 3.2; \ do \ rm -f rolling_checksum_pyx_mod.c; \ rm -f rolling_checksum_pyx_mod.o; \ rm -f rolling_checksum_pyx_mod.so; \ /usr/local/cpython-$$pyvers/bin/python \ /usr/local/cpython-$$pyvers/bin/cython \ rolling_checksum_pyx_mod.pyx; \ gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC \ -I/usr/local/cpython-$$pyvers/include/python$$pyvers -c rolling_checksum_pyx_mod.c; \ gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions rolling_checksum_pyx_mod.o \ -o rolling_checksum_pyx_mod.so; \ cp rolling_checksum_pyx_mod.so /usr/local/cpython-$$pyvers/lib/python$$pyvers/site-packages/.; \ done rm -f rolling_checksum_pyx_mod.so make test-rolling_checksum_pyx_mod.2.uto make test-rolling_checksum_pyx_mod.3.uto touch rcms # gcc -shared rolling_checksum_pyx_mod.o -o rolling_checksum_pyx_mod.so \ # -L/usr/local/cpython-$$pyvers/lib/python$$pyvers/config \ # -lpython$$pyvers; \ # rolling_checksum_py_mod.py: rolling_checksum_mod.m4 m4 -Dpy=1 rolling_checksum_mod.m4 > rolling_checksum_py_mod.py rolling_checksum_pyx_mod.pyx: rolling_checksum_mod.m4 m4 -Dpyx=1 rolling_checksum_mod.m4 > rolling_checksum_pyx_mod.pyx documentation: $(all_files) # snakefood for an import graph sfood ${all_files} | sfood-graph > doc/imports.dot dot -Tps doc/imports.dot > doc/imports.ps # pyreverse for package and class diagrams PYTHONPATH=$$(pwd) pyreverse -f ALL -a1 -s1 -p backshift ${all_files} mv packages_backshift.dot doc/. mv classes_backshift.dot doc/. dot -Tps doc/packages_backshift.dot > doc/packages_backshift.ps dot -Tps doc/classes_backshift.dot > doc/classes_backshift.ps epydoc --graph all --docformat=plaintext ${all_files} rm -rf doc/html mv html doc/. clean: rm -f *.pdf input-file output-file *.o *.so *.pyc *-pylint.html tags *.class *.uto treap.py py_treap.py py_treap_node.py rm -f *\$$py.class # for Jython cd tests; make clean cd treap; make veryclean rm -rf __pycache__ rm -f rcms rm -f rcm-input-data # these are automatically generated from a _mod.m4 file rm -f *_py_mod.py rm -f rolling_checksum_pyx_mod.pyx rm -f rolling_checksum_pyx_mod.c rm -f *.dot *.ps doc/*.dot doc/*.ps rm -rf html doc/html rm -f backshiftc