forked from volkanunsal/postgres-rrule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (22 loc) · 781 Bytes
/
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
TESTS = $(find tests -name test_\*.sql)
clean:
psql -c "DROP SCHEMA IF EXISTS _rrule CASCADE"
schema:
cat src/schema.sql >> postgres-rrule.sql
types:
find src/types -name \*.sql | sort | xargs -L 1 -J % cat % >> postgres-rrule.sql
functions:
find src/functions -name \*.sql| sort | xargs -L 1 -J % cat % >> postgres-rrule.sql
operators:
find src/operators -name \*.sql | sort | xargs -L 1 -J % cat % >> postgres-rrule.sql
casts:
find src/casts -name \*.sql | sort | xargs -L 1 -J % cat % >> postgres-rrule.sql
test:
psql -c "CREATE EXTENSION IF NOT EXISTS pgtap;" && pg_prove tests/test_*.sql
rm_rules:
rm -f postgres-rrule.sql
compile: rm_rules schema types functions operators casts
execute:
psql -X -f postgres-rrule.sql
dev: execute
all: compile execute