1 |
# DT Flickr |
2 |
# |
3 |
# Douglas Thrift |
4 |
# |
5 |
# $Id$ |
6 |
|
7 |
ifeq ($(OS),Windows_NT) |
8 |
setup := python setup.py |
9 |
chmod := --chmod=u+rw,go+r,Da+x,Fa-x |
10 |
PATH :=$(PATH);C:\\cygwin\\bin |
11 |
else |
12 |
setup := $(CURDIR)/setup.py |
13 |
chmod := |
14 |
endif |
15 |
|
16 |
upload = $(wildcard dist/$(shell $(setup) --fullname)*) |
17 |
server := backless.douglasthrift.net |
18 |
base := DouglasThrift.net/APT |
19 |
target := $(base)/data/files/$(shell $(setup) --name) |
20 |
stamp = $(patsubst dist/%,$(target)/%,$(upload)) |
21 |
|
22 |
.PHONY: all binary build clean register source upload |
23 |
|
24 |
all: build |
25 |
|
26 |
binary: |
27 |
ifneq ($(OS),Windows_NT) |
28 |
$(setup) bdist --formats egg upload -s |
29 |
else |
30 |
$(setup) bdist_wininst -p win32 --user-access-control auto upload -s |
31 |
$(setup) bdist_wininst -p win-amd64 --user-access-control auto upload -s |
32 |
endif |
33 |
|
34 |
build: |
35 |
$(setup) build |
36 |
|
37 |
clean: |
38 |
$(setup) clean |
39 |
|
40 |
register: |
41 |
$(setup) register |
42 |
|
43 |
ifneq ($(OS),Windows_NT) |
44 |
source: |
45 |
$(setup) sdist --formats bztar,gztar,zip upload -s |
46 |
endif |
47 |
|
48 |
upload: |
49 |
rsync -Pptv $(chmod) $(upload) $(server):$(target) |
50 |
ssh $(server) "$(base)/bin/apt-stamp update $(stamp)" |