bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Auto deps problem with newest make


From: Tadeusz J Liszka
Subject: Auto deps problem with newest make
Date: Thu, 13 Sep 2007 21:31:04 -0500
User-agent: Thunderbird 2.0.0.6 (X11/20070728)

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:address@hidden ~...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:address@hidden ~...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 address@hidden ) > $@

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) \
            $< > address@hidden) 2> .temp.out  \
          || ( cat .temp.out )
        sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < address@hidden > $@
#       @mv address@hidden $@
#       @$(FIX_P)
#       @rm address@hidden .temp.out


clean:
        rm -f a.out test.o */test.o

reply via email to

[Prev in Thread] Current Thread [Next in Thread]