Makefile problem

Hi,

We are using QNX4.24 and Watcom C/C++ compiler 10.6

We have our .cc files which when compiled (using make utility) produced
two executable files. These executables are different from each other
and are separated in the C code using compiler directive #ifdef.

Currently we call two different makefiles for the two executables from
one super makefile.
The *.o files are generated in the same directory where the source files
are, while we want the *.o files in different
directories.

We tried to specify the path using proper path using macros, but the
dependency file (depend.mk) that is generated using the Makefile (using
the makedepend utility) shows the path of the *.o as the same as that of
the *.cc. We feel that the macros we are using may be used only by the
linker, which is only possible when the depend file is proper.

How do we get the correct path of the *.o files in the depend.mk file?
Are there any flags to be set for the makedepend so that we can specify
the path?

We tried the -fo option, but that doesn’t seem to work.

Any help will be much appreciated.

Thanks,
Hemant

i don’t know if this is a good answer but what i usually do is do the make
in the dir that i want the objects to be created in, then reference the
source and include files by using …/…/src pathnames.

i do this so that i can have objects created for different targets other
than x86 if i need to.

there is also the -F option to force objects to be in the same dir as the
src.

Hemant Mohan <hemantm@pune.tcs.co.in> wrote:

Hi,

We are using QNX4.24 and Watcom C/C++ compiler 10.6

We have our .cc files which when compiled (using make utility) produced
two executable files. These executables are different from each other
and are separated in the C code using compiler directive #ifdef.

Currently we call two different makefiles for the two executables from
one super makefile.
The *.o files are generated in the same directory where the source files
are, while we want the *.o files in different
directories.

We tried to specify the path using proper path using macros, but the
dependency file (depend.mk) that is generated using the Makefile (using
the makedepend utility) shows the path of the *.o as the same as that of
the *.cc. We feel that the macros we are using may be used only by the
linker, which is only possible when the depend file is proper.

How do we get the correct path of the *.o files in the depend.mk file?
Are there any flags to be set for the makedepend so that we can specify
the path?

We tried the -fo option, but that doesn’t seem to work.

Any help will be much appreciated.

Thanks,
Hemant




Randy Martin randy@qnx.com
Manager of FAE Group, North America
QNX Software Systems www.qnx.com
175 Terence Matthews Crescent, Kanata, Ontario, Canada K2M 1W8
Tel: 613-591-0931 Fax: 613-591-3579