blob: 9e5d5d4b78e844a9d7f60c47b712bb457f4300ef (
plain)
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
|
SQL = mysql
USER = $(shell id -un)
HOST = localhost
.PHONY: clean permissions init data procedures full
all: full
# delete old tables and create new tables
init: base.sql
$(SQL) < $<
# fill tables with data
data: data.sql
$(SQL) < $<
# add procedures/sql functions
procedures: procedures.sql
$(SQL) < $<
# do all of the above in one go
full: full.sql
$(SQL) < $<
base.sql: reset.sql init.sql
cat $^ > $@
full.sql: reset.sql init.sql demo.sql views.sql functions.sql procedures.sql
cat $^ > $@
data.sql:
./import.py > $@
# grant all database permissions (development only)
permissions:
echo "grant all privileges on formula1.* to '$(USER)'@'$(HOST)';"
# delete generated sql files
clean:
$(RM) full.sql base.sql data.sql
|