blob: aff4d909f86c8a77e6e5abfa023a9775a598de24 (
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
|
src=../../src
import=-i$(src)/runtime/haskell:$(src)/compiler
cbind=../c-bindings
pyversion = $(shell python -c 'import sys; print ".".join(`t` for t in sys.version_info[:2])')
pythoninc=/usr/include/python$(pyversion)
debug= #-optc '-DDEBUG=1'
exdir=../../examples/tutorial/embedded
build: gf.so
test:
python test.py
gf.so: PyGF.hs gfmodule.c Query.pgf
ghc $(import) --make -fglasgow-exts -O2 -no-hs-main -c $<
ghc -O2 --make -fglasgow-exts -no-hs-main -optl '-shared' \
-optc '-DMODULE=$(basename $<)' $(debug) -optc '-I$(pythoninc)' -o $@ \
$(filter-out %.pgf, $^)
clean:
rm -f *.hi *.o
rm -f *_stub.*
rm -f PyGF.hs
superclean:
make clean
rm -f Query.pgf
rm -f gf.so
rm -f mtest
PyGF.hs: PyGF.hsc
hsc2hs -I$(pythoninc) $<
Query.pgf:
gf --make $(exdir)/QueryEng.gf $(exdir)/QuerySpa.gf
|