cosmetic
[sfa.git] / Makefile
1 #
2 ## (Re)builds Python metafile (__init__.py) and documentation
3
4 # overwritten by the specfile
5 DESTDIR="/"
6
7 init := geni/__init__.py geni/util/__init__.py geni/methods/__init__.py 
8 subdirs := keyconvert #pyOpenSSL-0.9
9
10 all: install
11
12 install: $(init) $(subdirs) install-python
13
14 install-python:
15         python setup.py install --root=$(DESTDIR) --record=GENI_INSTALLED_FILES
16
17 $(subdirs): $(init)
18
19 $(subdirs): %:
20         $(MAKE) -C $@
21
22 clean:
23         python setup.py clean
24         for i in $(subdirs); do make -C $$i clean ; done
25
26 index: $(init)
27
28 index-clean:
29         rm $(init)
30
31 .phony: all install install-python force clean index $(subdirs)
32
33 force:
34
35 # are the .java files used ?
36 tags:   
37         find . -name '*.py' -o -name '*.sh' -o -name '*.ecore'  | grep -v '/\.svn/' | xargs etags
38
39 ########## indexes
40 geni/__init__.py:
41         (echo '## Please use make index to update this file' ; echo 'all = """' ; cd geni; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
42
43 geni/methods/__init__.py:
44         (echo '## Please use make index to update this file' ; echo 'all = """' ; cd geni/methods; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
45
46 geni/util/__init__.py:
47         (echo '## Please use make index to update this file' ; echo 'all = """' ; cd geni/util; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
48
49 geni_now := $(sort $(shell fgrep -v '"' geni/__init__.py 2>/dev/null))
50 # what should be declared
51 geni_paths := $(filter-out %/__init__.py, $(wildcard geni/*.py))
52 geni_files := $(sort $(notdir $(geni_paths:.py=)))
53 ifneq ($(geni_now), $(geni_files))
54 geni/__init__.py: force
55 endif
56
57 methods_now := $(sort $(shell fgrep -v '"' geni/methods/__init__.py 2>/dev/null))
58 # what should be declared
59 method_paths := $(filter-out %/__init__.py, $(wildcard geni/methods/*.py))
60 method_files := $(sort $(notdir $(method_paths:.py=)))
61 ifneq ($(methods_now), $(methods_files))
62 geni/methods/__init__.py: force
63 endif
64
65 util_now := $(sort $(shell fgrep -v '"' geni/util/__init__.py 2>/dev/null))
66 # what should be declared
67 util_paths := $(filter-out %/__init__.py, $(wildcard geni/util/*.py))
68 util_files := $(sort $(notdir $(util_paths:.py=)))
69 ifneq ($(util_now), $(util_files))
70 geni/util/__init__.py: force
71 endif
72