Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 43 lines (32 sloc) 1.066 kb
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
PYTHON = python
#PYTHON = $(HOME)/bin/python2.6
CC = gcc
CFLAGS = -std=c99 $(shell $(PYTHON)-config --cflags)
#LD_LIBRARY_PATH = $(HOME)/lib
#export LD_LIBRARY_PATH
LDFLAGS = -L$(LD_LIBRARY_PATH) $(shell $(PYTHON)-config --ldflags)
PYTHONPATH +=.:termkey
export PYTHONPATH


all: clean build run_memleak run_tests

clean:
@rm -rf build
@rm -f ./test_memleak
@find . -name '_termkey*so' -exec rm "{}" \;
@find . -name '*.pyc' -exec rm "{}" \;
@echo "Cleaned."

build_ext: clean
$(PYTHON) setup.py build_ext -fi
#mv termkey/termkey/_termkey.so termkey/

build_memleak: clean
$(CC) -o test_memleak test_memleak.c $(CFLAGS) $(LDFLAGS)

build: build_ext build_memleak

run_memleak: build_ext build_memleak
./test_memleak
#LD_LIBRARY_PATH= gdb

grind_memleak: build_ext build_memleak
valgrind --tool=memcheck --leak-check=full --show-reachable=yes --track-origins=yes \
./test_memleak

run_tests: build_ext
$(PYTHON) ~/bin/nosetests $* || $(PYTHON)

run_stress: build_ext
$(PYTHON) test_memleak.py
Something went wrong with that request. Please try again.