PG_INCLUDE=`pg_config --includedir-server`
PG_LIBDIR=`pg_config --libdir`
PG_PACKAGE=`pg_config --pkglibdir`

all: tseries

tseries:
	gcc -ggdb -fpic -I$(PG_INCLUDE) tseries.c -c -o tseries.o
	gcc -ggdb -shared -o tseries.so tseries.o
	cp tseries.so $(PG_PACKAGE)/tseries.so
	/etc/init.d/postgres restart
