1
|
export PGOPTIONS = --client-min-messages=WARNING
|
2
|
|
3
|
psqlOpts = --set ON_ERROR_STOP=1 --quiet
|
4
|
psqlAdmin = sudo -u postgres psql $(psqlOpts)
|
5
|
psqlDbUser = ./util/psql_vegbien $(psqlOpts)
|
6
|
|
7
|
all: install
|
8
|
|
9
|
.SUFFIXES:
|
10
|
|
11
|
FORCE:
|
12
|
.PHONY: FORCE
|
13
|
|
14
|
|
15
|
install: user db
|
16
|
|
17
|
uninstall: rm_db rm_user
|
18
|
|
19
|
reinstall: uninstall install
|
20
|
|
21
|
reinstall_db: rm_db db
|
22
|
|
23
|
empty_db:
|
24
|
$(psqlDbUser) <../mappings/schemas/vegbien_empty.sql
|
25
|
|
26
|
user: FORCE
|
27
|
-./admin/bien_user_create
|
28
|
# ignore errors about existing user
|
29
|
|
30
|
rm_user: FORCE
|
31
|
echo "DROP USER bien;"|$(psqlAdmin)
|
32
|
|
33
|
db: FORCE
|
34
|
$(psqlAdmin) <../mappings/schemas/vegbien.sql
|
35
|
|
36
|
rm_db: FORCE
|
37
|
echo "DROP DATABASE vegbien;"|$(psqlAdmin)
|
38
|
|
39
|
|
40
|
test: test-map
|
41
|
|
42
|
test-%: FORCE
|
43
|
./test/$(*F)
|