

## The top of the corresponding Postgres build tree
SRCDIR=/usr/src/postgresql-8.1-8.1.11/build-tree/postgresql-8.1.11
## Postgres API version;  80=8.0; 81=8.1; 82=8.2; included in 8.3...
PGLEVEL=81

all:
	gcc -O2 -c -DPIC -fPIC -I./uuid/include \
          -I$(SRCDIR)/src/include \
          -I`pg_config --includedir-server` src/*.c

	gcc -L`pg_config --libdir` -shared *.o -lpq -luuid -o pguuid.so


dist: INSTALL README COPYING sql/pguuid.sql src/*.c
	mkdir -p dist
	tar czf dist/pguuid.tar.gz INSTALL README COPYING sql/pguuid.sql \
	  src/*.c

clean:
	rm -r dist
	rm *.o *.so

