1 |
dir=`pwd` |
2 |
code=pgswish |
3 |
|
4 |
all: pgswish install |
5 |
psql test < pgswish.sql |
6 |
psql -c "begin ; select pgswish('"${dir}"/index/test', 'a* or b* or c*', '', '') ; select * from foo ; drop table foo" test |
7 |
# cat test.sql | sed "s,##dir##,${dir}," | psql test |
8 |
|
9 |
pgswish: |
10 |
cc -I`pg_config --includedir-server` -fpic -c ${code}.c |
11 |
cc -shared -lswish-e -o ${code}.so ${code}.o |
12 |
|
13 |
clean: |
14 |
rm -Rf index |
15 |
|
16 |
index: |
17 |
mkdir index |
18 |
swish-e -S fs -i . -f index/test |
19 |
|
20 |
install: ${code}.so |
21 |
sudo cp ${code}.so `pg_config --pkglibdir` |