-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
30 lines (24 loc) · 918 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
testTargets := $(subst /schemas,,$(patsubst %/structure.sql,%.hs,$(wildcard test/*/schemas/*/structure.sql)))
squealgen: squealgen.sql mksquealgen.sh
./mksquealgen.sh
install: squealgen
install squealgen $(prefix)/bin/squealgen
.PHONY: test
test: squealgen $(testTargets)
@echo "testtargets: " $(testTargets)
stack test --ghc-options="-fprint-potential-instances"
foo:
echo $(testTargets)
clean:
rm $(testTargets)
.PHONY: initdb_exists
initdb_exists:
which initdb
testwatch: initdb_exists
while true; do \
make test; \
inotifywait -r -e modify -e create -e delete -e move $$(find test -iname '*.hs' | grep -v '#' | grep -v Schema.hs) $$(find . -iname '*\.sql' | grep -v '#' ) squealgen.sql mksquealgen.sh Makefile stack.yaml package.yaml ;\
done
# todo: bomb out if `schema` doesn't exist.
%.hs: schemas/%/structure.sql schemas/%/extra_imports squealgen
./buildTestSchema.sh $(dir $*) $(notdir $*)