ML> bin/CIBLE_%.elf : SUBST=$(shell echo $* | sed "s|^CIBLE_||")

This doesn't work as you seem to expect.  Remember, make operates in
two phases: reading and evaluating the dag.  Here, the RHS is
evaluated immediately upon reading the makefile - the shell command is
run before any file is bound to the rule.  Furthermore, it is illegal
to use $* in the prerequisites list of a rule (either pattern, static
pattern, explicit or suffix), so $* would be empty in any case.


ML> bin/CIBLE_%.elf : DEPENDANCES=$(addprefix lib/CIBLE_, $(shell cat src/$(SUBST).mk 
| egrep "^$(SUBST).elf" | cut -d':' -f2))
ML> 
ML> bin/CIBLE_%.elf:$(DEPENDANCES)
ML>     @echo "DEPENDANCES -> $(DEPENDANCES)"
ML>     dld ${CIBLE_LINK_OPT} -o $@ $(DEPENDANCES) src/CIBLE_$*.dld -m2 > 
bin/CIBLE_$*.map 

Of course, all this fails because SUBST is empty...


ML> The two first lines are there so as to get the prerequisites (in
ML> the variable $(DEPENDANCES) ) of the binary I'm interested in.

If all this is to get the prerequisite file list in a variable, then
use $^ - it contains the names of all prerequisites separated by
spaces.


Hope this helps,
-- 
Robert



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to