forked from Bitstackers/ServerStack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
127 lines (101 loc) · 5.22 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
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
PWD=$(shell pwd)
DB_SRC=${PWD}/db_src
DB_SCHEMA=postgresql/schema.sql
DB_DATA=postgresql/test_data.sql
TIMESTAMP=$(shell date +%s)
PREFIX?=/usr/local/databaseservers
OUTPUT_DIRECTORY=out
AuthBinary=AuthServer.dart
CallFlowBinary=CallFlow.dart
ContactBinary=ContactServer.dart
LogBinary=LogServer.dart
MessageBinary=MessageServer.dart
MessageDispatcherBinary=MessageDispatcher.dart
MiscBinary=MiscServer.dart
NotificationBinary=NotificationServer.dart
ReceptionBinary=ReceptionServer.dart
SpawnerBinary=Spawner.dart
-include makefile.dbsetup
all: $(OUTPUT_DIRECTORY) auth callflow contact log message messagedispatcher misc reception spawner notification
configs: */bin/config.json.dist
for source in */bin/config.json.dist; do \
target=$${source%%.dist}; \
cp -np $${source} $${target}; \
done
dependency:
cd AuthServer/ && pub get
cd CallFlowControl/ && pub get
cd CDRServer/ && pub get
cd ContactServer/ && pub get
cd LogServer/ && pub get
cd ManagementServer/ && pub get
cd MessageServer/ && pub get
cd MessageDispatcher/ && pub get
cd MiscServer/ && pub get
cd NotificationServer/ && pub get
cd ReceptionServer/ && pub get
cd spawner/ && pub get
cd UserServer/ && pub get
upgrade-dependency:
cd AuthServer/ && pub upgrade
cd CallFlowControl/ && pub upgrade
cd CDRServer/ && pub upgrade
cd ContactServer/ && pub upgrade
cd LogServer/ && pub upgrade
cd ManagementServer/ && pub upgrade
cd MessageServer/ && pub upgrade
cd MessageDispatcher/ && pub upgrade
cd MiscServer/ && pub upgrade
cd NotificationServer/ && pub upgrade
cd ReceptionServer/ && pub upgrade
cd spawner/ && pub upgrade
cd UserServer/ && pub upgrade
auth:
dart2js --output-type=dart --checked --verbose --out=$(OUTPUT_DIRECTORY)/${AuthBinary} --categories=Server AuthServer/bin/authserver.dart
callflow:
dart2js --output-type=dart --checked --verbose --out=$(OUTPUT_DIRECTORY)/${CallFlowBinary} --categories=Server CallFlowControl/bin/callflowcontrol.dart
contact:
dart2js --output-type=dart --checked --verbose --out=$(OUTPUT_DIRECTORY)/${ContactBinary} --categories=Server ContactServer/bin/contactserver.dart
log:
dart2js --output-type=dart --checked --verbose --out=$(OUTPUT_DIRECTORY)/${LogBinary} --categories=Server LogServer/bin/logserver.dart
message:
dart2js --output-type=dart --checked --verbose --out=$(OUTPUT_DIRECTORY)/${MessageBinary} --categories=Server MessageServer/bin/messageserver.dart
messagedispatcher:
dart2js --output-type=dart --checked --verbose --out=$(OUTPUT_DIRECTORY)/${MessageDispatcherBinary} --categories=Server MessageDispatcher/bin/messagedispacher.dart
misc:
dart2js --output-type=dart --checked --verbose --out=$(OUTPUT_DIRECTORY)/${MiscBinary} --categories=Server MiscServer/bin/miscserver.dart
notification:
dart2js --output-type=dart --checked --verbose --out=$(OUTPUT_DIRECTORY)/${NotificationBinary} --categories=Server NotificationServer/bin/notificationserver.dart
reception:
dart2js --output-type=dart --checked --verbose --out=${OUTPUT_DIRECTORY}/${ReceptionBinary} --categories=Server ReceptionServer/bin/receptionserver.dart
spawner:
dart2js --output-type=dart --checked --verbose --out=${OUTPUT_DIRECTORY}/${SpawnerBinary} --categories=Server spawner/bin/spawner.dart
$(OUTPUT_DIRECTORY):
mkdir -p $(OUTPUT_DIRECTORY)
clean:
rm -rf $(OUTPUT_DIRECTORY)
install: all
install --directory ${PREFIX}
install --target-directory=${PREFIX} $(OUTPUT_DIRECTORY)/*.dart
install-default-config:
@install --directory ${PREFIX}
@install AuthServer/bin/config.json.dist ${PREFIX}/authconfig.json
@install CallFlowControlWrapper/bin/config.json.dist ${PREFIX}/callflowcontrolconfig.json
@install ContactServer/bin/config.json.dist ${PREFIX}/contactconfig.json
@install LogServer/bin/config.json.dist ${PREFIX}/logconfig.json
@install MessageServer/bin/config.json.dist ${PREFIX}/messageconfig.json
@install MessageDispatcher/bin/config.json.dist ${PREFIX}/messagedispatcherconfig.json
@install MiscServer/bin/config.json.dist ${PREFIX}/miscconfig.json
@install ReceptionServer/bin/config.json.dist ${PREFIX}/receptionconfig.json
# This rule depends on a .pgpass file containing the password for the user specified in makefile.dbsetup
latest_db_install:
make -C ${DB_SRC} ${DB_SCHEMA} ${DB_DATA}
psql -c "SELECT pid, (SELECT pg_terminate_backend(pid)) as killed from pg_stat_activity WHERE datname = '${PGDB}'" --host=${PGHOST} --username=${PG_SUPER_USER} -w;
-psql -c "ALTER DATABASE ${PGDB} RENAME TO ${PGDB}_${TIMESTAMP}" --host=${PGHOST} --username=${PG_SUPER_USER} -w
psql -c "CREATE DATABASE ${PGDB} WITH OWNER = ${PGUSER} ENCODING='UTF8' LC_COLLATE='da_DK.UTF-8' LC_CTYPE='da_DK.UTF-8' TEMPLATE = template0;" --host=${PGHOST} --username=${PG_SUPER_USER} -w
PGOPTIONS='--client-min-messages=warning' psql ${PGARGS} --dbname=${PGDB} --file=${DB_SRC}/${DB_SCHEMA} --host=${PGHOST} --username=${PGUSER} -w
LANG=C.UTF-8 PGOPTIONS='--client-min-messages=warning' psql ${PGARGS} --dbname=${PGDB} --file=${DB_SRC}/${DB_DATA} --host=${PGHOST} --username=${PGUSER} -w
#$(OUTPUT_DIRECTORY)/NotificationServer.dart : NotificationServer/bin/notificationserver.dart NotificationServer/lib/*.dart
# mkdir -p "`dirname $@`"
# cd `basename $@ .dart` && pub get
# dart2js --output-type=dart --checked --verbose --out=$@ --categories=Server $<