1# 2# STFL - The Structured Terminal Forms Language/Library 3# Copyright (C) 2006, 2007 Clifford Wolf <clifford@clifford.at> 4# 5# This library is free software; you can redistribute it and/or 6# modify it under the terms of the GNU Lesser General Public 7# License as published by the Free Software Foundation; either 8# version 3 of the License, or (at your option) any later version. 9# 10# This library is distributed in the hope that it will be useful, 11# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13# Lesser General Public License for more details. 14# 15# You should have received a copy of the GNU Lesser General Public 16# License along with this library; if not, write to the Free Software 17# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 18# MA 02110-1301 USA 19# 20 21PYTHON_VERSION = $(shell python -V 2>&1 | cut -f2 -d' ' | cut -f1-2 -d'.') 22PYTHON_SITEARCH = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") 23 24all: python/_stfl.so python/stfl.py python/stfl.pyc 25 26install: install_python 27 28python/_stfl.so python/stfl.py python/stfl.pyc: libstfl.a stfl.h python/stfl.i swig/*.i 29 cd python && swig -python -threads stfl.i 30 gcc -shared -pthread -fPIC python/stfl_wrap.c -I/usr/include/python$(PYTHON_VERSION) \ 31 -I. libstfl.a -lncursesw -o python/_stfl.so 32 cd python && python -c 'import stfl' 33 34install_python: python/_stfl.so python/stfl.py python/stfl.pyc 35 mkdir -p $(DESTDIR)$(PYTHON_SITEARCH)/ 36 mkdir -p $(DESTDIR)$(PYTHON_SITEARCH)/lib-dynload/ 37 cp python/_stfl.so $(DESTDIR)$(PYTHON_SITEARCH)/lib-dynload/ 38 cp python/stfl.pyc $(DESTDIR)$(PYTHON_SITEARCH)/ 39 cp python/stfl.py $(DESTDIR)$(PYTHON_SITEARCH)/ 40 41