bug-make
[Top][All Lists]
Advanced

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

[bug #21231] $(wildcard ) function sometimes fails very strangely


From: Jun Chen
Subject: [bug #21231] $(wildcard ) function sometimes fails very strangely
Date: Wed, 03 Oct 2007 01:51:27 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

URL:
  <http://savannah.gnu.org/bugs/?21231>

                 Summary: $(wildcard ) function sometimes fails very
strangely
                 Project: make
            Submitted by: chjfth
            Submitted on: Wednesday 10/03/2007 at 09:51
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 3.81
        Operating System: Any
           Fixed Release: None

    _______________________________________________________

Details:

    I encountered a strange situation recently, $(wildard ) function seems
failing to work. See my code below:

========================================================
all: first_target

outfile = out.txt

$(outfile):
        @echo nnn > $@

.PHONY: prj_count
prj_count:
        @echo "[[$(outfile)]] <<$(wildcard $(outfile))>> "

.PHONY: first_target
first_target: $(outfile) prj_count
        @echo "[DONE]"
========================================================

First, delete out.txt and run make on that makefile, the output is
 
[[out.txt]] <<>>
[DONE]

then, run make again, the output is
 
[[out.txt]] <<out.txt>>
[DONE]

Result of the first run is strange. When target prj_count is being made,
out.txt should have been generated on my disk(because $(outfile) had been made
before), then WHY $(wildcard out.txt) gives me null result ? 
 
I've tested it on make 3.80 & 3.81 on Linux and on Windows(MSVC-built), both
produce the same result.

Reference mailling list item:
http://lists.gnu.org/archive/html/help-make/2007-09/msg00060.html





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?21231>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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