-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
143 lines (123 loc) · 6.33 KB
/
Makefile
File metadata and controls
143 lines (123 loc) · 6.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# This Makefile isn't primarily concerned with building a binary, but sets up this folder after a fresh checkout
# Setup
.SILENT:
# Explicit builds
default: bin src/utils/nmd
@echo Done
all: bin src/utils/nmd src/tags doc/html aws
@echo Done
package: src DISCLAIMER INSTALL LICENSE NOTICE README
@echo "Building package in apache-tashi.tar.gz"
rm -rf apache-tashi.tar.gz apache-tashi
mkdir apache-tashi
cp -rp doc etc Makefile src DISCLAIMER INSTALL LICENSE NOTICE README apache-tashi/
find apache-tashi -type d -name ".svn"|xargs rm -rf
-chgrp -R incubator apache-tashi
tar zcf apache-tashi.tar.gz apache-tashi
rm -rf apache-tashi
doc: rmdoc doc/html
@echo Done
clean: rmnmd rmbin rmtags rmdoc rmaws
if [ `find . -name "*.pyc" | wc -l` -gt 0 ]; then echo Removing python byte-code...; rm `find . -name "*.pyc"`; fi
@echo Done
version:
sed -i "s/version = .*/version = \"`date +%Y-%m-%d`\"/" src/tashi/version.py
aws: src/tashi/aws/wsdl/AmazonEC2_services_types.py src/tashi/aws/wsdl/AmazonEC2_services_server.py
src/tashi/aws/wsdl/AmazonEC2_services_types.py: src/tashi/aws/wsdl/2009-04-04.ec2.wsdl
(cd src/tashi/aws/wsdl; wsdl2py -b --file ./2009-04-04.ec2.wsdl)
src/tashi/aws/wsdl/AmazonEC2_services_server.py: src/tashi/aws/wsdl/2009-04-04.ec2.wsdl
(cd src/tashi/aws/wsdl; wsdl2dispatch --file ./2009-04-04.ec2.wsdl)
src/tashi/aws/wsdl/2009-04-04.ec2.wsdl:
wget -O src/tashi/aws/wsdl/2009-04-04.ec2.wsdl http://s3.amazonaws.com/ec2-downloads/2009-04-04.ec2.wsdl
rmaws:
if test -e src/tashi/aws/wsdl/2009-04-04.ec2.wsdl; then echo Removing aws...; rm -f src/tashi/aws/wsdl/2009-04-04.ec2.wsdl; rm -f src/tashi/aws/wsdl/AmazonEC2_*.py; fi
src/utils/nmd: src/utils/nmd.py
ln -s ../src/utils/nmd.py ./bin/nmd
#rmnmd:
# if test -e src/utils/nmd; then echo Removing nmd...; (cd src/utils; make clean); rm -f bin/nmd; fi
rmnmd:
echo Removing nmd...; rm -f bin/nmd
bin: bindir bin/clustermanager bin/nodemanager bin/tashi-client bin/tashi-admin bin/primitive bin/zoni-cli bin/accounting
bindir:
if test ! -d bin; then mkdir bin; fi
rmbin: rmclustermanager rmnodemanager rmtashi-client rmtashi-admin rmprimitive rmzoni-cli rmaccounting
if test -d bin; then rmdir bin; fi
bin/getInstances:
if test ! -e bin/getInstances; then (echo "Generating client symlinks..."; cd bin; PYTHONPATH=../src ../src/tashi/client/client.py --makesyms); fi
rmclients:
if test -e bin/getInstances; then (echo Removing client symlinks...; cd bin; PYTHONPATH=../src ../src/tashi/client/client.py --rmsyms; cd ..); fi
bin/accounting: src/tashi/accounting/accounting.py
@echo Symlinking in Accounting server...
(cd bin; ln -s ../src/tashi/accounting/accounting.py accounting)
rmaccounting:
if test -e bin/accounting; then echo Removing Accounting server symlink...; rm bin/accounting; fi
bin/clustermanager: src/tashi/clustermanager/clustermanager.py
@echo Symlinking in clustermanager...
(cd bin; ln -s ../src/tashi/clustermanager/clustermanager.py clustermanager)
rmclustermanager:
if test -e bin/clustermanager; then echo Removing clustermanager symlink...; rm bin/clustermanager; fi
bin/nodemanager: src/tashi/nodemanager/nodemanager.py
@echo Symlinking in nodemanager...
(cd bin; ln -s ../src/tashi/nodemanager/nodemanager.py nodemanager)
rmnodemanager:
if test -e bin/nodemanager; then echo Removing nodemanager symlink...; rm bin/nodemanager; fi
bin/primitive: src/tashi/agents/primitive.py
@echo Symlinking in primitive...
(cd bin; ln -s ../src/tashi/agents/primitive.py primitive)
rmprimitive:
if test -e bin/primitive; then echo Removing primitve-agent symlink...; rm bin/primitive; fi
bin/tashi-client:
@echo Symlinking in tashi-client...
(cd bin; ln -s ../src/tashi/client/tashi-client.py tashi-client)
rmtashi-client:
if test -e bin/tashi-client; then echo Removing tashi-client symlink...; rm bin/tashi-client; fi
bin/tashi-admin:
@echo Symlinking in tashi-admin...
(cd bin; ln -s ../src/tashi/client/tashi-admin.py tashi-admin)
rmtashi-admin:
if test -e bin/tashi-admin; then echo Removing tashi-admin symlink...; rm bin/tashi-admin; fi
src/tags:
@echo Generating tags...
(cd src; ctags-exuberant -R --c++-kinds=+p --fields=+iaS --extra=+q -f ./tags .)
rmtags:
if test -e src/tags; then echo Removing tags...; rm src/tags; fi
doc/html:
@echo Generating HTML docs...
epydoc --html -o doc/html --include-log --name=tashi --graph=all --exclude=tashi.messaging.messagingthrift ./src/tashi
rmdoc:
if test -d doc/html; then echo Removing HTML docs...; rm -rf ./doc/html; fi
# Zoni
bin/zoni-cli:
@echo Symlinking in zoni-cli...
(cd bin; ln -s ../src/zoni/client/zoni-cli.py zoni-client)
# why necessarily put this in /usr/local/bin like nothing else?
usr/local/bin/zoni:
@echo Creating /usr/local/bin/zoni
(echo '#!/bin/bash\nPYTHONPATH=$(shell pwd)/src $(shell pwd)/bin/zoni-cli.py $$*' > /usr/local/bin/zoni; chmod 755 /usr/local/bin/zoni)
rmzoni-cli:
if test -e bin/zoni-cli; then echo Removing zoni-cli symlink...; rm bin/zoni-cli; fi
if test -e /usr/local/bin/zoni; then echo Removing zoni...; rm /usr/local/bin/zoni; fi
## for now only print warnings having to do with bad indentation. pylint doesn't make it easy to enable only 1,2 checks
disabled_warnings=$(shell pylint --list-msgs|grep :W0| awk -F: '{ORS=","; if ($$2 != "W0311" && $$2 != "W0312"){ print $$2}}')",F0401"
pysrc=$(shell find . \! -path '*gen-py*' \! -path '*services*' \! -path '*messagingthrift*' \! -name '__init__.py' -name "*.py")
tidy: $(addprefix tidyfile/,$(pysrc))
@echo Ensured .py files are nice and tidy!
tidyfile/%: %
@echo Checking tidy for $*
pylint --report=no --disable=R,C,E --disable=$(disabled_warnings) --indent-string="\t" $* 2> /dev/null;