32fc46f65d485a678ac35ec7d39f2f15b1df4f9a
[sfa.git] / Makefile
1 #
2 ## (Re)builds Python metafile (__init__.py) and documentation
3 #
4
5 # Meta
6 init := geni/__init__.py geni/util/__init__.py geni/methods/__init__.py 
7
8 subdirs := keyconvert #pyOpenSSL-0.9
9  
10 all: install $(init) $(subdirs)
11
12 install: 
13         python setup.py install
14
15 $(subdirs): $(init)
16
17 $(subdirs): %:
18         $(MAKE) -C $@
19
20 clean:
21         python setup.py uninstall
22         cd keyconvert && make clean
23         # XX remove keyconvert   
24
25 index: $(init)
26
27 index-clean:
28         rm $(init)
29
30 .phony: all install force clean index $(subdirs)
31
32 geni/__init__.py:
33         (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()') > $@
34
35 geni/methods/__init__.py:
36         (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()') > $@
37
38 geni/util/__init__.py:
39         (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()') > $@
40
41 geni_now := $(sort $(shell fgrep -v '"' geni/__init__.py 2>/dev/null))
42 # what should be declared
43 geni_paths := $(filter-out %/__init__.py, $(wildcard geni/*.py))
44 geni_files := $(sort $(notdir $(geni_paths:.py=)))
45 ifneq ($(geni_now), $(geni_files))
46 geni/__init__.py: force
47 endif
48
49 methods_now := $(sort $(shell fgrep -v '"' geni/methods/__init__.py 2>/dev/null))
50 # what should be declared
51 method_paths := $(filter-out %/__init__.py, $(wildcard geni/methods/*.py))
52 method_files := $(sort $(notdir $(method_paths:.py=)))
53 ifneq ($(methods_now), $(methods_files))
54 geni/methods/__init__.py: force
55 endif
56
57 util_now := $(sort $(shell fgrep -v '"' geni/util/__init__.py 2>/dev/null))
58 # what should be declared
59 util_paths := $(filter-out %/__init__.py, $(wildcard geni/util/*.py))
60 util_files := $(sort $(notdir $(util_paths:.py=)))
61 ifneq ($(util_now), $(util_files))
62 geni/util/__init__.py: force
63 endif
64
65 force:
66
67 .PHONY: all install force clean index tags $(subdirs)