[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TR: Adresses email sur les probl?mes gmake
From: |
Robert Mecklenburg |
Subject: |
Re: TR: Adresses email sur les probl?mes gmake |
Date: |
Fri, 9 Jan 2004 12:07:43 -0700 |
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