qnx makefiles

Wave++ a écrit :

Alain Bonnefoy <> alain.bonnefoy@icbt.com> > wrote:
I tried to insert these lines at the end of the common.mk:
-----------After the last line of common.mk------------
all: deps.mk
install: all
deps.mk:
( cd $(PROJECT_ROOT); makedepend -f $(PROJECT_ROOT)/deps.mk -D$(OS)
-D$(CPU) $(addprefix -I, $(INCVPATH)) *.c *.h 2>/dev/null;
cd $(PROJECT_ROOT)/$(OS); makedepend -a -f $(PROJECT_ROOT)/deps.mk -D$(OS)
-D$(CPU) $(addprefix -I, $(INCVPATH)) *.c *.h 2>/dev/null; )

include $(PROJECT_ROOT)/deps.mk
-------End of common.mk-----------

It works ok!
deps.mk is generated at each make invocation. But I think it’s normal. It’s
impossible to figure out when dependencies are no more valid of course! Or
you know the dependecies yet!

There’s a problem here.
If you erase the deps.mk file make will stop.
And you can figure out why:

make parses all the common.mk, INCLUDES deps.mk and THEN executes the
directives. That’s why you should generate dependecies before the
variant level (or, build sources after it).

Another direct problem follows:

If you change some dependencies, make will ignore them until you launch
it for the second time (since in the first one dependencies will be
regenerated).

To stop make rebuilding deps.mk every time, simpy change it’s
directive:

deps.mk: $(wildcard $(PROJECT_ROOT)/*.cc)

whatever

Cheers


Wave++

Ok with everything Wave++, I put back the deps.mk generation in the bottom level
makefile and everything is ok. I even solve a problem I had to build my project
through rsh.

Great!!

Thanks a lot,
Alain.