<commit_before>#
# (Re)builds Python metafiles (__init__.py) and documentation
#
# <NAME> <<EMAIL>>
# Copyright (C) 2005 The Trustees of Princeton University
#
# $Id$
# $URL$
#

# Metafiles - manage Legacy/ and Accessors by hand
init := PLC/__init__.py PLC/Methods/__init__.py 

# python-pycurl and python-psycopg2 avail. from fedora 5
# we used to ship our own version of psycopg2 and pycurl, for fedora4
# starting with 5.0, support for these two modules is taken out

# Other stuff - doc not implicit, it's redone by myplc-docs
subdirs := php php/xmlrpc

# autoconf compatible variables
DESTDIR := /
datadir := /usr/share
bindir := /usr/bin

PWD := $(shell pwd)

all: $(init) $(subdirs) 
	python setup.py build

install: 
	python setup.py install \
	    --install-purelib=$(DESTDIR)/$(datadir)/plc_api \
	    --install-scripts=$(DESTDIR)/$(datadir)/plc_api \
	    --install-data=$(DESTDIR)/$(datadir)/plc_api
	install -D -m 755 php/xmlrpc/xmlrpc.so $(DESTDIR)/$(shell php-config --extension-dir)/xmlrpc.so

$(subdirs): $(init)

$(subdirs): %:
	$(MAKE) -C $@

clean: 
	find . -name '*.pyc' | xargs rm -f
	rm -f $(INIT)
	for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir clean ; done
	python setup.py clean && rm -rf build

index: $(init)

index-clean:
	rm $(init)

#################### regenerate indexes - not used by the build, as both files are svn added - please update as appropriate

########## PLC/
# the current content of __init__.py
PLC_now := $(sort $(shell fgrep -v '"' PLC/__init__.py 2>/dev/null))
# what should be declared
PLC_paths := $(filter-out %/__init__.py, $(wildcard PLC/*.py))
PLC_files := $(sort $(notdir $(PLC_paths:.py=)))

ifneq ($(PLC_now),$(PLC_files))
PLC/__init__.py: force
endif
PLC/__init__.py: 
	echo "This step is obsolete"

########## Methods/
# the current content of __init__.py
METHODS_now := $(sort $(shell fgrep -v '"' PLC/Methods/__init__.py 2>/dev/null))
# what should be declared
METHODS_paths := $(filter-out %/__init__.py, $(wildcard PLC/Methods/*.py PLC/Methods/system/*.py))
METHODS_files := $(sort $(notdir $(subst system/, system., $(METHODS_paths:.py=))))

ifneq ($(METHODS_now),$(METHODS_files))
PLC/Methods/__init__.py: force
endif
PLC/Methods/__init__.py: 
	echo "This step is obsolete"

##########

force:

.PHONY: all install force clean index tags $(subdirs)

#################### devel tools
tags:
	find . '(' -name '*.py' -o -name '*.sql' -o -name '*.php' -o -name Makefile ')' | xargs etags
<commit_msg>Cleanup old targets in Makefile.<commit_after>#
# (Re)builds Python metafiles (__init__.py) and documentation
#
# <NAME> <<EMAIL>>
# Copyright (C) 2005 The Trustees of Princeton University
#
# $Id$
# $URL$
#

# python-pycurl and python-psycopg2 avail. from fedora 5
# we used to ship our own version of psycopg2 and pycurl, for fedora4
# starting with 5.0, support for these two modules is taken out

# Other stuff - doc not implicit, it's redone by myplc-docs
subdirs := php php/xmlrpc

# autoconf compatible variables
DESTDIR := /
datadir := /usr/share
bindir := /usr/bin

PWD := $(shell pwd)

all: $(subdirs) 
	python setup.py build

install: 
	python setup.py install \
	    --install-purelib=$(DESTDIR)/$(datadir)/plc_api \
	    --install-scripts=$(DESTDIR)/$(datadir)/plc_api \
	    --install-data=$(DESTDIR)/$(datadir)/plc_api
	install -D -m 755 php/xmlrpc/xmlrpc.so $(DESTDIR)/$(shell php-config --extension-dir)/xmlrpc.so

$(subdirs): %:
	$(MAKE) -C $@

clean: 
	find . -name '*.pyc' | xargs rm -f
	rm -f $(INIT)
	for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir clean ; done
	python setup.py clean && rm -rf build

index:
	echo "This step is obsolete"

##########

force:

.PHONY: all install force clean index tags $(subdirs)

#################### devel tools
tags:
	find . '(' -name '*.py' -o -name '*.sql' -o -name '*.php' -o -name Makefile ')' | xargs etags

{'fraction_non_alphanumeric': 0.18029788345962897, 'fraction_numerical': 0.0073164358505356675, 'mean_word_length': 3.8211586901763224, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1899288', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1363, 'n_words': 419}