#
# $Id: Makefile,v 1.8 2001/02/11 20:04:39 mrnolta Exp $
#
# Copyright (C) 2000-2001 Mike Nolta <mrnolta@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA  02111-1307, USA.
#

PYTHON		= python
PYPREFIX	= $(shell $(PYTHON) -c 'import sys; print sys.prefix')
PYVERSION	= $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
PYSITEPKGS	= $(PYPREFIX)/lib/python$(PYVERSION)/site-packages
PROCTITLESDIR	= $(PYSITEPKGS)/proctitle

SRCDIR		= ./src

export PYPREFIX PYVERSION

.PHONY: all install uninstall clean

all:
	cd $(SRCDIR) && $(MAKE) all

install: all
	[ -d $(PROCTITLESDIR) ] || mkdir -m755 $(PROCTITLESDIR)
	install -m644 $(SRCDIR)/*.py  $(PROCTITLESDIR)
	install -m644 $(SRCDIR)/*.pyc $(PROCTITLESDIR)
	install -m755 $(SRCDIR)/*.so  $(PROCTITLESDIR)

uninstall:
	[ -d $(PROCTITLESDIR) ] && rm -rf $(PROCTITLESDIR)

clean:
	cd $(SRCDIR) && $(MAKE) clean
	
distclean: clean
	-rm -R build/

