forked from liuq880077/popush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (57 loc) · 1.53 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
68
69
70
.PHONY: clean npm static conf start stop server bin deploy all
LIB_DIR = lib
BIN_DIR = bin
STATIC_DIR = static
APPARMOR_DIR = /etc/apparmor.d
NGINX_CONF = /usr/local/nginx/conf/nginx.conf
NGINX = /etc/init.d/nginx
POPUSH = /etc/init.d/popush
TMP_DIR = tmp
FACE_DIR = static/faces
TARGET = $(TMP_DIR) $(FACE_DIR)
all: npm $(TARGET)
server: all static conf
deploy: all static bin conf
start:
@echo "> start popush"
@sudo service popush restart 1>/dev/null
stop:
@echo "> stop popush"
@sudo service popush stop 1>/dev/null
npm:
@echo "> npm install"
@npm install
static:
@echo "> do not make static"
conf:
@echo "> configure"
@sudo cp $(LIB_DIR)/nginx.conf $(NGINX_CONF)
@sudo cp $(LIB_DIR)/nginx $(NGINX)
@sudo update-rc.d nginx defaults 1>/dev/null 2>&1
@sudo cp $(LIB_DIR)/popush $(POPUSH)
@sudo update-rc.d popush defaults 1>/dev/null 2>&1
@sudo cp $(LIB_DIR)/apparmor.d/* $(APPARMOR_DIR)/
@echo "> restart apparmor"
@sudo service apparmor restart 1>/dev/null 2>&1
@echo "> restart nginx"
@sudo service nginx restart 1>/dev/null
$(TMP_DIR):
@echo "> make $@"
@-mkdir $@
$(FACE_DIR):
@echo "> make $@"
@-mkdir $@
bin:
@echo "> make bin"
@rm -rf $(BIN_DIR)
@-mkdir $(BIN_DIR)
@gcc -o $(BIN_DIR)/a $(LIB_DIR)/a.c
@cp `which gdb` $(BIN_DIR)/gdb
@cp `which node` $(BIN_DIR)/node
@cp `which python2.7` $(BIN_DIR)/python
@cp `which perl` $(BIN_DIR)/perl
@cp `which ruby` $(BIN_DIR)/ruby
@cp `which lua` $(BIN_DIR)/lua
@cp -r `readlink -f \`which java\` | sed "s:bin/java:jre:"` $(BIN_DIR)/
clean:
@rm -rf $(TMP_DIR)/*