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: plcsh,v 1.3 2006/01/09 19:57:24 mlhuang Exp $
11 INIT := PLC/__init__.py PLC/Methods/__init__.py
16 all: $(INIT) $(SUBDIRS)
22 find . -name '*.pyc' -execdir rm -f {} +
24 for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir clean ; done
26 # All .py files in PLC/
27 PLC := $(filter-out %/__init__.py, $(wildcard PLC/*.py))
28 PLC_init := all = '$(notdir $(PLC:.py=))'.split()
31 echo "$(PLC_init)" >$@
33 ifneq ($(sort $(PLC_init)), $(sort $(shell cat PLC/__init__.py 2>/dev/null)))
34 PLC/__init__.py: force
37 # All .py files in PLC/Methods/ and PLC/Methods/system/
38 METHODS := $(filter-out %/__init__.py, $(wildcard PLC/Methods/*.py PLC/Methods/system/*.py))
39 Methods_init := methods = '$(notdir $(subst system/, system., $(METHODS:.py=)))'.split()
41 PLC/Methods/__init__.py:
42 echo "$(Methods_init)" >$@
44 ifneq ($(sort $(Methods_init)), $(sort $(shell cat PLC/Methods/__init__.py 2>/dev/null)))
45 PLC/Methods/__init__.py: force
50 .PHONY: force clean $(SUBDIRS)