-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (53 loc) · 1.66 KB
/
Makefile
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
#!/bin/bash
# ===========================================================
# Author: Marcos Lin, Hooman Korasani
# Created: 03 May 2013
# Updated: 11 Dec 2013
#
# Makefile used to setup django-appengine-template application
#
# ===========================================================
SRC = src
PTENV = prt-env
PIP = $(PTENV)/bin/pip
PYLIB_REQ = tools/pylib_req.txt
PYLIB_REQ_PRE = tools/pylib_req_pre.txt
PYLIB_SRC = $(SRC)/lib
PKG_DEF = django isodate dateutil pytz rauth passlib PIL unittest2 nose
PKG_DEF_PY = facebook.py
# ------------------
# USAGE: First target called if no target specified
man :
@cat readme.make
@cat pylib_req.txt
# ------------------
# Define file needed
$(PIP) :
ifeq ($(shell which virtualenv),)
$(error virtualenv command needed to be installed.)
endif
@mkdir -p $(PYLIB_SRC)
@virtualenv --no-site-packages $(PTENV)
$(PTENV)/pylib_req.txt : $(PYLIB_REQ)
@$(PIP) install -r $(PYLIB_REQ)
@$(PIP) install --pre -r $(PYLIB_REQ_PRE)
@cp -a $(PYLIB_REQ) $@
# ------------------
# MAIN TARGETS
virtualenv : $(PIP) $(PTENV)/pylib_req.txt $(PYLIB_SRC)
setup_lib : $(PTENV)/lib/python2.7/site-packages
@for dir in $(PKG_DEF); do \
mkdir -p $(PYLIB_SRC)/$$dir; \
rsync -av $^/$$dir/ $(PYLIB_SRC)/$$dir/; \
done
@for file in $(PKG_DEF_PY); do \
rsync -av $^/$$file $(PYLIB_SRC)/; \
done
# touch $(PYLIB_SRC)/flaskext/__init__.py
cp $(PTENV)/lib/python2.7/site-packages/closure/closure.jar tools/
cp $(PTENV)/lib/python2.7/site-packages/cssmin.py tools/
setup : virtualenv setup_lib
# ------------------
# DEFINE PHONY TARGET: Basically all targets
.PHONY : \
man virtualenv setup setup_lib