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

2007-11-26 Thread Jun Chen

Follow-up Comment #2, bug #21231 (project make):

Thank you for your comment on Friday 11/23/07. As you said, putting out.txt
in a subdir does not exhibit the problem -- that's right. However, I
encountered that $(wildcard ) problem in my real-world makefiles when
out.txt(other name may be used though) is put in a subdir within current dir.
Since my real-world working makefiles(GnumakeUniproc) are quite complicated so
that it is unsuitable to paste it here as an example, I tried to dig out the
simplist case that show my problem(as my post here on Wednesday 10/03/07).


However, beside from using GnumakeUniproc, I find it's hard to forge an
example that can demonstrate the $(wildcard ) problem when the file being
tested by $(wildcar ) is in a subdir.

Anyhow, I think it should be a problem to fix.

(Attachment is a makefile that does show this problem, for memorial purpose.)

(file #14489)
___

Additional Item Attachment:

File name: tt.mk  Size:1 KB


___

Reply to this item at:

  

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



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


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

2007-10-02 Thread Jun Chen

URL:
  

 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]] <>
[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:

  

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



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #18641] GNUmake 3.81, $(error ) sometimes unable to stop make process

2007-01-29 Thread Jun Chen

Follow-up Comment #3, bug #18641 (project make):

Thanks a lot for your reply, Paul. You catch my meaning right.

I believe that the "include warning suppression" is expected for nearly every
person using GNUmake. People use the ``gcc -M' technique mentioned in GNU make
manual to generate .d files to be included into their makefiles, so, if you do
not provide a way to suppress that warning, they will see a lot of "No such
file or directory" warnings for .d files when they start a clean build.

Could you tell me how you're going to solve this (in make 3.82 for example)
and at the same time try to maintain makefile behavior compatibility across
at least 3.82, 3.81 and 3.80 ?

And perhaps you can have a look at my GnumakeUniproc project just submitted
to sf.net:
https://gnumakeuniproc.svn.sourceforge.net/svnroot/gnumakeuniproc/GMU-manual/trunk/quick-start/quick-start.htm

___

Reply to this item at:

  

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



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #18755] exported var-define and var-define from command line should appear in $(shell ) env

2007-01-10 Thread Jun Chen

URL:
  

 Summary: exported var-define and var-define from command
line should appear in $(shell ) env 
 Project: make
Submitted by: chjfth
Submitted on: Thursday 01/11/07 at 10:23
Severity: 3 - Normal
  Item Group: Enhancement
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 3.81
Operating System: None
   Fixed Release: None

___

Details:


See the following makefile:

===
export EXVAR = exval

_temp := $(shell echo "EXVAR = $${EXVAR}, CMDVAR = $${CMDVAR}" 1>&2)

all:
===

``make CMDVAR=cmdval'' currently outputs: 

---
EXVAR = , CMDVAR =
make: `all' is up to date.
---

But in some situation, the following output is expected:

---
EXVAR = exval, CMDVAR = cmdval
make: `all' is up to date.
---

I encountered this problem when I was working on my GnumakeUniproc project in
the past year(http://sf.net/projects/gnumakeuniproc), and I have to find a
workaround for it -- unfortunately.

I hope GNUmake's next version gives a option to enable my suggested
behavior.

By the way, an anonymous person has posted such issue two years ago.
https://savannah.gnu.org/bugs/?10593




___

Reply to this item at:

  

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



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #18641] GNUmake 3.81, $(error ) sometimes unable to stop make process

2007-01-03 Thread Jun Chen

Follow-up Comment #1, bug #18641 (project make):

[2007-01-04]

Well, with the help of Martin Dorey, I've got to know that this bug has
nothing to do with make's $(error ) function, but a make behavior change for
``-include '' directive. Since I used ``-include $(_p_SubprjsMade)'' instead
of ``include $(_p_SubprjsMade) '' in my makefile, failure to remake
$(_p_SubprjsMade) will not stop the whole make process.

After removing the dash from ``-include $(_p_SubprjsAttrMade)'' , the make
process goes as I've expected on GNUmake 3.80 as well as GNUmake 3.81,
however, I have to suffer from the noisy ":: No such
file or directory" warning output by make.

___

Reply to this item at:

  

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



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #17245] $(notdir foo/) should return . instead of blank

2006-12-30 Thread Jun Chen

Follow-up Comment #1, bug #17245 (project make):

Well, if you need such functionality, you can write your own function:


MyNotDir_1 = $(if $(patsubst %/,,$1),$(notdir $1),.)#OK
MyNotDir = $(foreach v,$1,$(call MyNotDir_1,$v))


Now, MyNotDir acts as you expect.

I've tested it on make 3.80 & make 3.81.

Of course, GNUmake should better add a new internal function for this, so
that users like you don't have to bother adding his own functions.

___

Reply to this item at:

  

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



___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


[bug #18641] GNUmake 3.81, $(error ) sometimes unable to stop make process

2006-12-30 Thread Jun Chen

URL:
  

 Summary: GNUmake 3.81, $(error ) sometimes unable to stop
make process
 Project: make
Submitted by: chjfth
Submitted on: Saturday 12/30/2006 at 22:03
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 think I've found in GNUmake 3.81 a hard-to-realize bug. This bug causes
$(error ) function unable to stop the whole make process. I encountered this
bug recently when I'm developing an auto-building system based on
GNUmake(called GnumakeUniproc), and I have isolate the smallest
makefile(filename: eGmu.makefile, 30 effective lines, see the attached file)
that can reproduce this problem. 

Be aware, in order to see this bug, you have to `rm
_MainPrjBuildStart.gmu.ckt' before invoking my makefile, -- honestly, you
just have to do it.

Output from make 3.81:
===
[chj @vchjsuse101 ~/test/clear381]
$ make381 -f eGmu.makefile
make381[1]: Entering directory `/home/chj/test/clear381'
_SubprjsAttr.gmu.mki:1: *** == Hey! you should stop here!
[./_MakeSubPrjs.gmu.mk] ==.  Stop.
make381[1]: Leaving directory `/home/chj/test/clear381'
_SubprjsAttr.gmu.mki:1: *** == Hey! you should stop here! [eGmu.makefile]
==.  Stop.
===
You can see that `` :: *** .
Stop.'' appears more than once, which is not the correct behavior.

GNUmake 3.80 does not have this bug however. Output from make 3.80:
===
[chj @vchjsuse101 ~/test/clear381]
$ make380 -f eGmu.makefile
make[1]: Entering directory `/home/chj/test/clear381'
_SubprjsAttr.gmu.mki:1: *** == Hey! you should stop here!
[./_MakeSubPrjs.gmu.mk] ==.  Stop.
make[1]: Leaving directory `/home/chj/test/clear381'
make: *** [_SubprjsMade.gmu.ckt] Error 2
===

My testing environment:
* SuSE Linux 10.1 with stock make 3.80.
* And I build make 3.81 from official source on SuSE Linux 10.1 with command
./configure && make .




###

Finally, I also post my eGmu.makefile here:



_IsP1OlderThanP2 = $(if $(wildcard $1),$(shell (if [ $1 -ot $2 ];then echo -n
'1';fi)),1)
# If file $1 not exist or older than $2, 1 is returned, else null is
returned.
# If $2 does not exist, result is undetermined.
_IsOlderThanPrjStart = $(call _IsP1OlderThanP2,$1,$(_p_MainPrjStart))
_ClearFile = echo -n "" > $(1)

gmu_Gd_PRJ_GMUTMP = .

_StartupSignatureFile = _MainPrjBuildStart.gmu.ckt

ifeq ($(MAKELEVEL),0)

  export _p_MainPrjStart = $(CURDIR)/$(_StartupSignatureFile)
# Important! User should first delete it before invoking the makefile of
the main-project!
#Otherwise, the build can be incomplete.

  ifeq (,$(wildcard $(_p_MainPrjStart))) # Do these only if the
main-prj-start signature does not exist.

# The first thing here is to create the main-prj-start signature, so 
that
the code
# in this  if/endif will only execute once during one whole build 
process.
_temp := $(shell if (echo -n "" > $(_p_MainPrjStart)) ; then echo -n '';
\
else echo __GMU_ex_ERROR; fi; )
ifneq (,$(_temp))
  $(error !GMU!Error: Cannot create start-up signature
file($(_StartupSignatureFile)) in current dir)
endif

  endif # ifeq (,$(wildcard $(_p_MainPrjStart)))

endif # ifeq ($(MAKELEVEL),0)


_p_mki_SubprjAttr = $(gmu_Gd_PRJ_GMUTMP)/_SubprjsAttr.gmu.mki
_p_SubprjsAttrMade = $(gmu_Gd_PRJ_GMUTMP)/_SubprjsAttrMade.gmu.ckt

_p_mk_MakeSubPrjs = $(gmu_Gd_PRJ_GMUTMP)/_MakeSubPrjs.gmu.mk
_p_SubprjsMade = $(gmu_Gd_PRJ_GMUTMP)/_SubprjsMade.gmu.ckt


-include $(_p_SubprjsMade)

$(_p_SubprjsMade): $(_p_MainPrjStart)
@$(call _ClearFile,$(_p_mk_MakeSubPrjs))
@echo -e "include $(_p_mki_SubprjAttr)\n" >> $(_p_mk_MakeSubPrjs)
@${MAKE} -f $(_p_mk_MakeSubPrjs)
@echo -n "" > $@

ifeq ($(call _IsOlderThanPrjStart,$(_p_SubprjsAttrMade)),1)
#  $(warning % [$(MAKELEVEL)] [$(MAKE_RESTARTS)]
%%%)
  -include $(_p_SubprjsAttrMade)
else
#  $(warning + [$(MAKELEVEL)] [$(MAKE_RESTARTS)]
+++)
  include $(_p_mki_SubprjAttr)
endif

$(_p_SubprjsAttrMade): $(_p_MainPrjStart)
@$(call _ClearFile,$(_p_mki_SubprjAttr))
@echo "\$$(error == Hey! you should stop here! [\$$(firstword
\$$(MAKEFILE_LIST))] ==)" >> $(_p_mki_SubprjAttr)
@echo -n "" > $@ # touch it





___

File Attachments:


---
Date: Saturday 12/30/2006 at 22