QNX 6 IDE Makefile Structure ... Confusing

Hello,

I have been searching the forums and learning about the Makefile recursive hierarchy, but I still haven’t found anything simple enough for me to understand.

I am new using QNX IDE. I have a card driver that provides me with the following files:

x26demo
x26demo.c
x26.h
x26.o

And I’m given a Makefile that is simply:
x26demo: x26demo x26.o
cc - o x26demo x26demo.o x26.o

x26demo.o: x26demo.c x26.h
cc -c x26demo.c

I don’t have any problems running the Makefile from the command line. However, I’m trying to incorporate the Makefile given above into the recursive makefiles in IDE.

I’ve already created a project in IDE, and added the “x26demo.o: x26demo.c x26.h …” lines into the Makefile of the x86/o/ folder, however, I don’t know where to include the “x26demo: x26demo x26.o …” line into the Makefile hierarchy so that the driver actually compiles.

If someone could give me some simple directions, that would be greatly appreciated. I’ve never written complicated Makefiles before.

If you use the IDE you can let it use your makefile (makefile project) or let it build the makefile for you. Basical with a c/C++ projet you don’t have to deal with the makefiles.

There is a section in the manual about the COMMON makefiles system.

I remember reading about that, but I wasn’t sure about something. The C code I have is an encoder card driver. I want to be able to use the card to control multiple DC motors simultaneously. Technically, I could use a UNIX system with C/C++ to control the motors by forking processes. But in QNX, if I create a basic “C/C++ project” opposed to a “QNX C Project”, do I still have the same multi-processing ability, or am I somehow limited? What’s the difference, other than the recursive makefiles?

Thanx.

If you make a QNX C/C++ project all you have to do is copy in the .c files to the top of the project and it will build them without any makefile changes.

If you want to use you makefile create a Standard Make project and copy in everything.

I have a QNX C/C++ project and can compile without worrying about makefiles. However, I now would like to organize the code into sub-systems by creating sub-directories within the same project. I don’t mind editing the makefiles provided to include the macros if I can avoid writing traditional makefiles. What is the best way to do that?

EXTRA_SRCVPATH+=$(PROJECT_ROOT)/section1 $(PROJECT_ROOT)/section2

That will do it, add it to common.mk.