override CPPFLAGS := -I../../include -I$(top_srcdir)/src/interfaces/ecpg/include \
	-I$(libpq_srcdir) $(CPPFLAGS) 
override CFLAGS += $(PTHREAD_CFLAGS) 

override LDFLAGS := -L../../ecpglib -L../../pgtypeslib $(LDFLAGS)
override LIBS := -lecpg -lpgtypes $(libpq) $(LIBS) $(PTHREAD_LIBS)

ECPG = ../../preproc/ecpg -I$(srcdir)/../../include

%: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@

%.c: %.pgc ../regression.h
	$(ECPG) -o $@ -I$(srcdir) $<

clean:
	rm -f $(TESTS) $(TESTS:%=%.o) $(TESTS:%=%.c)

