#
#  Insert the source code tree and POSTGRES installation here
#
POSTGRESTREE=/u1/postgres
PORT = sparc
OFILES = raster.so polyfuncs.so
CFLAGS = -O -I$(POSTGRESTREE)/include -I$(POSTGRESTREE)/src/backend -I$(POSTGRESTREE)/src/backend/port/$(PORT)
LDFLAGS = -L$(POSTGRESTREE)/lib -lm -lpq

.SUFFIXES: .so

.c.o:
	cc $(CFLAGS) -c  $<

.o.so:
	ld -dc -dp -Bdynamic  -o $@ $<

all: fe2 $(OFILES)  test

fe2: fe2.o
	cc $(CFLAGS) -o fe2 fe2.o $(LDFLAGS)

test: test.o
	cc $(CFLAGS) -o test test.o $(LDFLAGS)

raster.so: raster.o

polyfuncs.so: polyfuncs.o

clean:
	rm -f $(OFILES) fe2 core fe2.o test test.o

setup.pq: setup.source
	sed -e "s%_BENCHDIR_%`pwd`%" -e "s/_SLSUFF_/so/" setup.source > setup.pq
