2 # (Re)builds Python metafiles (__init__.py) and documentation
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2005 The Trustees of Princeton University
7 # $Id: Makefile,v 1.6 2006/11/08 21:56:32 mlhuang Exp $
11 INIT := PLC/__init__.py PLC/Methods/__init__.py
16 # autoconf compatible variables
23 all: $(INIT) $(SUBDIRS)
25 # Install in the current directory so that we can import it
27 python setup.py build && \
28 python setup.py install --install-lib=$(PWD)
31 python setup.py install \
32 --install-purelib=$(DESTDIR)/$(datadir)/plc_api \
33 --install-scripts=$(DESTDIR)/$(datadir)/plc_api \
34 --install-data=$(DESTDIR)/$(datadir)/plc_api
36 python setup.py install --install-lib=$(DESTDIR)/$(datadir)/plc_api)
42 find . -name '*.pyc' | xargs rm -f
44 for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir clean ; done
45 python setup.py clean && rm -rf build
46 cd psycopg2 && python setup.py clean && rm -rf build
51 find . '(' -name '*.py' -o -name '*.sql' -o -name '*.php' -o -name Makefile ')' | xargs etags
54 # All .py files in PLC/
55 PLC := $(filter-out %/__init__.py, $(wildcard PLC/*.py))
56 PLC_init := all = '$(notdir $(PLC:.py=))'.split()
59 echo "$(PLC_init)" >$@
61 ifneq ($(sort $(PLC_init)), $(sort $(shell cat PLC/__init__.py 2>/dev/null)))
62 PLC/__init__.py: force
65 # All .py files in PLC/Methods/ and PLC/Methods/system/
66 METHODS := $(filter-out %/__init__.py, $(wildcard PLC/Methods/*.py PLC/Methods/system/*.py))
67 Methods_init := methods = '$(notdir $(subst system/, system., $(METHODS:.py=)))'.split()
69 PLC/Methods/__init__.py:
70 echo "$(Methods_init)" >$@
72 ifneq ($(sort $(Methods_init)), $(sort $(shell cat PLC/Methods/__init__.py 2>/dev/null)))
73 PLC/Methods/__init__.py: force
78 .PHONY: all install force clean index tags $(SUBDIRS)