Mail Archives: djgpp/1996/05/30/04:49:10
On 30/5/96 9:43 am, Roland Exler <R DOT Exler AT jk DOT uni-linz DOT ac DOT at> did thus say >>>
> I'm using gnu make (v3.73) as a kind of intelligent batch-file, not just
> for compiling c/c++. With the makefile below, make deletes the files
> lms0* at the end of the run, but this files are listed in 'lms' as
> desinations to create! Especially surprising is the fact, that make
> deletes it, but knows it has to create this files as if you run make
> again, it recompiles them.
[...]
>
> --------------------------- makefile --------------------------------
> OUT_DIR:=test/
> Z=$(subst /,\,$@)
>
> # may be list, such as
> #LMSPARAM:=050 020 010
> LMSPARAM:=050
>
> LMS_ERR:=$(addprefix lmse,$(LMSPARAM)) $(addprefix lmss,$(LMSPARAM))
>
> ..PHONY: all lms clear
^
This is not your problem, but you have one too many dots.
You need the following line somewhere in your makefile (tested). See 'info make
imp chain' for more info on intermediate files.
.PRECIOUS: $(addprefix $(OUT_DIR),$(LMS_ERR))
> all: $(OUT_DIR)s_in $(OUT_DIR)n_in \
> $(OUT_DIR)s_out $(OUT_DIR)n_out \
> lms
>
> lms: $(addprefix $(OUT_DIR),$(LMS_ERR))
>
> clear:
> deltree /y $(subst /,,$(OUT_DIR))
> del signal
> del noise
>
> # how to create file 'signal' and 'noise'
> signal noise:
> ECHO noise $@ > $Z
>
> $(OUT_DIR)s_in: signal
> md $(subst /,,$(dir $@))
> ECHO mult $< -a $@ > $Z
>
> $(OUT_DIR)n_in: noise
> md $(subst /,,$(dir $@))
> ECHO mult $< -a $@ > $Z
>
> %_out: %_in
> ECHO fir $< -c $@ > $Z
>
> $(OUT_DIR)out: $(OUT_DIR)s_out $(OUT_DIR)n_out
> ECHO add $^ $@ > $Z
>
> $(OUT_DIR)lmse0%: $(OUT_DIR)s_in $(OUT_DIR)out
> ECHO lms $^ -c $@ > $Z
>
> $(OUT_DIR)lmss0%: $(OUT_DIR)n_out $(OUT_DIR)lmse0%
> ECHO sub $^ $@ > $Z
This should help
Bill
- Raw text -