help-make
[Top][All Lists]
Advanced

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

Fw: gmake creates files that already exist and are up-to-date


From: Simon De Groot
Subject: Fw: gmake creates files that already exist and are up-to-date
Date: Fri, 7 Jan 2005 15:15:51 +0100


Hi,

I hope someone can help me out here. Consider the following makefile:

(start makefile)

.SECONDARY :

BLOCKS = one two
BLOCK_TS = $(BLOCKS:%=%_ent_build.ts)

CDS2HDL_SYM = $(BLOCKS)
CDS2HDL_ENT_TS = $(CDS2HDL_SYM:%=%_ent.ts)
CDS2HDL_ENTS_TS = cds2hdl_ents.ts

all : top_hl.ts ;

%_hl.ts : $(BLOCK_TS) $(CDS2HDL_ENTS_TS)
        touch $@

$(CDS2HDL_ENTS_TS) : $(CDS2HDL_ENT_TS)
        @echo "(batch) Making $(patsubst %.ts,%.vhd,$?)"
        touch $(patsubst %.ts,%.vhd,$?)
        touch $@

%_ent.ts : %.cdb
        touch $@

%_ent_build.ts : %_ent.vhd
        @echo NIY: Compile $*_ent.vhd
        touch $@

%_ent.vhd : %.cdb
        @echo "(single) Making $@ from $<"
        touch $@
        @echo "Touching timestamps for batch execution"
        touch $*_ent.ts
        touch $(CDS2HDL_ENTS_TS)

clean :
        rm -f *.ts
        rm -f *_ent.vhd
        rm -f *_highlevel.vhd

fake :
        touch $(patsubst %,%.cdb,$(BLOCKS))

(end makefile)

Now run:
%> make fake
%> make --debug

This will give you:

(start log)

Reading makefiles...
Updating goal targets....
 File `all' does not exist.
   File `top_hl.ts' does not exist.
     File `cds2hdl_ents.ts' does not exist.
       File `one_ent.ts' does not exist.
      Must remake target `one_ent.ts'.

touch one_ent.ts

      Successfully remade target file `one_ent.ts'.
       File `two_ent.ts' does not exist.
      Must remake target `two_ent.ts'.

touch two_ent.ts

      Successfully remade target file `two_ent.ts'.
    Must remake target `cds2hdl_ents.ts'.

(batch) Making one_ent.vhd two_ent.vhd
touch one_ent.vhd two_ent.vhd
touch cds2hdl_ents.ts

    Successfully remade target file `cds2hdl_ents.ts'.
    File `one_ent_build.ts' does not exist.
     File `one_ent.vhd' does not exist.
    Must remake target `one_ent.vhd'.

(single) Making one_ent.vhd from one.cdb
touch one_ent.vhd
Touching timestamps for batch execution
touch one_ent.ts
touch cds2hdl_ents.ts

    Successfully remade target file `one_ent.vhd'.
   Must remake target `one_ent_build.ts'.

NIY: Compile one_ent.vhd
touch one_ent_build.ts

   Successfully remade target file `one_ent_build.ts'.
    File `two_ent_build.ts' does not exist.
     File `two_ent.vhd' does not exist.
    Must remake target `two_ent.vhd'.

(single) Making two_ent.vhd from two.cdb
touch two_ent.vhd
Touching timestamps for batch execution
touch two_ent.ts
touch cds2hdl_ents.ts

    Successfully remade target file `two_ent.vhd'.
   Must remake target `two_ent_build.ts'.

NIY: Compile two_ent.vhd
touch two_ent_build.ts

   Successfully remade target file `two_ent_build.ts'.
  Must remake target `top_hl.ts'.

NIY: Compile top_highlevel.vhd
touch top_hl.ts

  Successfully remade target file `top_hl.ts'.
Must remake target `all'.
Successfully remade target file `all'.

(end log)

During '(batch)', one_ent.vhd is touched. However, shortly after, debug info reports: 'File `one_ent.vhd' does not exist.', although it has just been created. If you would switch the order of the dependencies of %_hl.ts, it works correctly.

Can anyone explain this?

Regards,

Simon.

reply via email to

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