building a c function

From: Stuart McGraw <smcg2297(at)frii(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: building a c function
Date: 2010-03-17 18:27:50
Message-ID: 4BA11F26.8090707@frii.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

I know this is a very elementary question, but my excuse
is I have not programmed in C or written makefiles for
15+ years...

I am trying to write a C-language function, call it my_func.
But I also have a my_subs.o that does the heavy lifting
for my_func.c. My makefile is:

MODULES = my_func
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
OBJS = my_subs.o # Is this right?

But I see no indication in the output that my_subs.o is
being used:

gcc -O2 -g ... -fpic -shared -o my_func.so my_func.o

How do I tell the makefile to include my_subs.o when building
the shared lib?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Smith 2010-03-17 19:13:26 update ... set ... subquery
Previous Message Greg Smith 2010-03-17 18:16:22 Re: stopping processes, preventing connections