When using autodependency as described in info the behavior of make
changed between 3.79.1 and 3.81 generating unexpected confusion -
makefile exits without error message but does not finish the target(s):
[o:[EMAIL PROTECTED] ~...tmp]$more .deps/test.P
test.o .deps/test.P : test.c xxxx
the xxxx above is bogus file, but it represents valid include file which
was deleted or moved
when makefile contains
include $(dep_files)
the result is as expected (It is PITA, but at least message is clear,
could it be possible to add rule to delete .deps/test.P and remake it ?)
[o:[EMAIL PROTECTED] ~...tmp]$make
make: *** No rule to make target `xxxx', needed by `.deps/test.P'. Stop.
but when makefile contains
-include $(dep_files)
makefile 3.81 simply exits
previous versions of make (in particular 3.79.1 in FC2) reported as
expected:
make: *** No rule to make target `xxxx', needed by `.deps/test.P'. Stop.
make -d shows:
......
Found an implicit rule for `test.o'.
Pruning file `test.c'.
Pruning file `test.c'.
Pruning file `xxxx'.
Finished prerequisites of target file `test.o'.
Giving up on target file `test.o'.
Finished prerequisites of target file `a.out'.
Giving up on target file `a.out'.
Actual working makefile attached
regards
--
## # ##### ## ### ### Tadeusz J. Liszka, Ph.D.
# # # # # # # # # Altair Engineering Inc.
#### # # #### # ### http://www.tx.altair.com
# # #### # # # ### # # tel. (512)467-0618 #526
dot_o = .o
depdir = .deps
objc = test.o
################################################
a.out : $(objc)
gcc $<
dep_files = $(patsubst %$(dot_o),$(depdir)/%.P,$(objc) $(objcc) $(objF))
FIX_P = ( echo $@ $(addsuffix $(dot_o),$(addprefix
$$\(obj_path\)/,$(MODULE_TAG) $*)) \\; cat [EMAIL PROTECTED] ) > $@
include $(depdir)/empty.P
$(depdir)/empty.P:
@test -d $(depdir) || mkdir $(depdir)
@touch $@
include $(dep_files)
$(dep_files): $(depdir)/empty.P
$(depdir)/%.P: %.c
@echo "mkdeps $< > $@"
@(gcc -MM \
$(filter -I%,$(CFLAGS)) \
$(filter -I%,$(include_opts)) \
$(filter -D%,$(CFLAGS)) \
$(filter -D%,$(h3d_flags)) \
$(CPPFLAGS) $(DEFS) \
$< > [EMAIL PROTECTED]) 2> .temp.out \
|| ( cat .temp.out )
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < [EMAIL PROTECTED] > $@
# @mv [EMAIL PROTECTED] $@
# @$(FIX_P)
# @rm [EMAIL PROTECTED] .temp.out
clean:
rm -f a.out test.o */test.o
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make