Setting up MAKE file for Postgres and C++/Newbie question

Started by Nonameover 24 years ago2 messageshackersgeneral
Jump to latest
#1Noname
shield123321@hotmail.com
hackersgeneral

I've found, compiled and tested the libpq++ c++ program examples. I've even
modified them to work with my database. Now I want to take an existing
program written in c++ and add the postgres classes. I also want to do this
in my working directory, not the samples directory. The make file with the
examples is pretty intense. Does anyone have a simpler version that will
set the appropriate paths for the includes? I naturally want to use the
header files included with postgres, not copy them around.

#2Lee Crampton
lee@avbrief.com
In reply to: Noname (#1)
hackersgeneral
Re: Setting up MAKE file for Postgres and C++/Newbie question

A make file can be very simple indeed. These days makefiles have become
almost incomprehensible to all but a few!
If you don't want to be flexible and portable in the extreme, a simple
makefile for the current directory for any project goes like this:
--------------------------------------
INC="/pathFor/Other/Includes"

foo : foo.o
gcc -o foo foo.o
foo.o : foo.c
gcc -c foo.c -I $(INC);
--------------------------------------
Some years ago I wrote a program makemake which created makefiles based on
the contents of the current dir.
It was for a DOS based system but should work anywhere (with perhaps a
couple of tweeks).
I will see if I can dig it out.
Hope this helps.
Lee Crampton

<shield123321@hotmail.com> wrote in message
news:0OtL7.43114$gQ1.17272737@news1.elmhst1.il.home.com...

I've found, compiled and tested the libpq++ c++ program examples. I've

even

modified them to work with my database. Now I want to take an existing
program written in c++ and add the postgres classes. I also want to do

this

in my working directory, not the samples directory. The make file with

the

Show quoted text

examples is pretty intense. Does anyone have a simpler version that will
set the appropriate paths for the includes? I naturally want to use the
header files included with postgres, not copy them around.