Brian Stecher a écrit:
Alain Bonnefoy <> alain.bonnefoy@icbt.com> > wrote:
subdirectories makefiles are:
\
EARLY_DIRS=mc_inversion_API
ifndef QRECURSE
QRECURSE=recurse.mk
ifdef QCONFIG
QRDIR=$(dir $(QCONFIG))
endif
endif
include $(QRDIR)$(QRECURSE)
pkg:
rm -f *.qpm *.qpk
packager -u
Ahh. There’s your problem.
You’re getting the redefinition because the recurse.mk is defining
a ‘pkg’ target because of your EXTRA_TARGETS definition and then
you define it again in the Makefile.
With the QNX makefiles (aside from the couple of macros defined
in a appendix B) you never, ever modify a recursing Makefile.
99.999999999999999999% of the time you never modify a variant
level Makefile (the one that includes the “common.mk”).
All the things that’d you normally add to a Makefile, you instead
add to the common.mk file. In this case you’d add:
pkg:
cd $(PROJECT_ROOT); rm -f *.qp[mk]; packager -u
after the include of qtargets.mk.
But I cannot include these rules in my common.mk files, because my
common.mk are not at the right levels.
I need to precise what I’d like to do:
We develop a package collection belonging to one project, named
mc_components:
mc_components
|-…
|-Makefile <---- The one with EXTRA_TARGET definition
|-package.qpg
|-mc_components-x.z.qpr
|
|-mc_triangle
| |-Makefile <------ The one with pkg: rm *.qp[mk]; packager -u
| |-package.qpg
| |-mc_triange-x.x.qp[mk]
| |
| |-mc_triangle
| | |-common.mk
| | |-Makefile
| | |-nto/x86/o
| |
| |-mc_triangle_API
| | |-common.mk
| | |-Makefile
| | |-nto/x86/so
| |
| |-mc_triangle_ctrl
| | |-common.mk
| | |-Makefile
| | |-nto/x86/o
|
|-mc_sinus
| |-Makefile <------ The one with pkg: rm *.qp[mk]; packager -u
| |-package.qpg
| |-mc_sinus-x.x.qp[mk]
| |
| |-mc_sinus
| | |-common.mk
| | |-Makefile
| | |-nto/x86/o
| |
| |-mc_sinus_API
| | |-common.mk
| | |-Makefile
| | |-nto/x86/so
| |
| |-mc_sinus_ctrl
| | |-common.mk
| | |-Makefile
| | |-nto/x86/o
|
.
.
So, I’d like that mc_components be ‘super package’, containing several
packages.
According to my tests, if I want that ‘make pkg’ started at
mc_components level, do all my packages, I need my EXTRA_TARGET=pkg
definition, to be recursive,
And, if I want to explain what to do on ‘make pkg’, I think that I need
the ‘pkg: rm…’ rules int the subdirectories Makefile.
No ?
Actually, all my packages are done as I want, I just have a problem to
make the mc_components.x.z.qpr because it must be done after all others.
I didn’t find a way to include pkg rule in the topmost makefile which
should be done AFTER all subdirectories pkg rules.
Any idea?
I can’t see any way aside from doing two makes, the first to create
the executables and the second to do the packaging.
But, it’s exactly as to make; make install ? I just want to make; make
pkg. What’s more logical on QNX?
I think I need something like a POST_INSTALL macros.
Regards,
Alain.