-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
67 lines (67 loc) · 1.88 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
ifeq ($(OS),Windows_NT)
ROOT_D := $(shell cd)
systest:
@echo Windows
clean:
rmdir /s /q $(ROOT_D)\src\dbctest
rmdir /s /q $(ROOT_D)\src\dbs
rmdir /s /q $(ROOT_D)\src\dbtest
rmdir /s /q $(ROOT_D)\src\__pycache__
del /q $(ROOT_D)\src\*.pem
init:
mkdir $(ROOT_D)\src\dbctest
mkdir $(ROOT_D)\src\dbtest
mkdir $(ROOT_D)\src\dbs
echo {} > $(ROOT_D)\src\dbs\logclient.json
echo {} > $(ROOT_D)\src\dbs\repoinf.json
echo {} > $(ROOT_D)\src\dbs\users.json
install:
pip install -r requirements.txt
run-server:
@echo Server is NOT supported in Windows... Use a Linux Machine!
run-client:
python $(ROOT_D)\src\client.py
ca-cert:
python $(ROOT_D)\src\ca_cert_gen.py
server-cert:
python $(ROOT_D)\src\server_cert_gen.py
python $(ROOT_D)\src\csr_sign.py
cert: ca-cert server-cert
prepare-env: install init cert
else
ROOT_L := $(shell pwd)
UNAME_S := $(shell uname -s)
systest:
@echo UNAME_S
clean:
rm -rf $(ROOT_L)/src/dbctest
rm -rf $(ROOT_L)/src/dbs
rm -rf $(ROOT_L)/src/dbtest
rm -rf $(ROOT_L)/src/__pycache__
rm -rf $(ROOT_L)/src/*.pem
init:
mkdir $(ROOT_L)/src/dbctest
mkdir $(ROOT_L)/src/dbs
echo {} > $(ROOT_L)/src/dbs/logclient.json
echo {} > $(ROOT_L)/src/dbs/repoinf.json
echo {} > $(ROOT_L)/src/dbs/users.json
mkdir $(ROOT_L)/src/dbtest
install:
pip3 install -r requirements.txt
ifeq ($(UNAME_S),Darwin)
CFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" UWSGI_PROFILE_OVERRIDE=ssl=true pip --no-cache-dir install uwsgi -Iv
else
pip3 install uwsgi
endif
run-server:
uwsgi --master --https localhost:5683,src/server-public-key.pem,src/server-private-key.pem --wsgi-file src/gateway.py --callable app --processes 4 --threads 4
run-client:
python3 $(ROOT_L)/src/client.py
ca-cert:
python3 $(ROOT_L)/src/ca_cert_gen.py
server-cert:
python3 $(ROOT_L)/src/server_cert_gen.py
python3 $(ROOT_L)/src/csr_sign.py
cert: ca-cert server-cert
prepare-dev: install init cert
endif