public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] Remove $(VERSION_FILE) from PHONY Target List
@ 2008-04-11 20:36 Grant Erickson
  2008-04-12 19:29 ` Mike Frysinger
  2008-05-09  8:22 ` Wolfgang Denk
  0 siblings, 2 replies; 6+ messages in thread
From: Grant Erickson @ 2008-04-11 20:36 UTC (permalink / raw)
  To: u-boot

When building against non-local, non-disk-backed file systems (e.g. NFS,
tmpfs), the u-boot build can iterate forever, attempting to re-generate
"include/autoconf.mk". This occurs because $(VERSION_FILE) (aka
${ROOT}/u-boot/build/include/version_autogenerated.h) is always regarded as
out-of-date because it is in the .PHONY target list, even though it's a real
file and seems to need to be only created once and only once.

This patch removes $(VERSION_FILE) from the .PHONY target list and has been
verified to work with various flavors and builds of make-3.81 against NFS,
ext2fs, ext3fs and tmpfs file systems.

More detail at:

http://sourceforge.net/mailarchive/message.php?msg_id=C4180895.E556%25gerick
son%40nuovations.com

Signed-off-by: Grant Erickson <gerickson@nuovations.com>

---
diff --git a/Makefile b/Makefile
index e5b4210..50069b7 100644
--- a/Makefile
+++ b/Makefile
@@ -247,7 +247,7
 LIBS += api/libapi.a
 
 LIBS := $(addprefix $(obj),$(LIBS))
-.PHONY : $(LIBS) $(VERSION_FILE)
+.PHONY : $(LIBS)
 
 # Add GCC lib
 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] Remove $(VERSION_FILE) from PHONY Target List
  2008-04-11 20:36 [U-Boot-Users] [PATCH] Remove $(VERSION_FILE) from PHONY Target List Grant Erickson
@ 2008-04-12 19:29 ` Mike Frysinger
  2008-04-13  6:20   ` Grant Erickson
  2008-05-09  8:22 ` Wolfgang Denk
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2008-04-12 19:29 UTC (permalink / raw)
  To: u-boot

On Friday 11 April 2008, Grant Erickson wrote:
> When building against non-local, non-disk-backed file systems (e.g. NFS,
> tmpfs), the u-boot build can iterate forever, attempting to re-generate
> "include/autoconf.mk". This occurs because $(VERSION_FILE) (aka
> ${ROOT}/u-boot/build/include/version_autogenerated.h) is always regarded as
> out-of-date because it is in the .PHONY target list, even though it's a
> real file and seems to need to be only created once and only once.
>
> This patch removes $(VERSION_FILE) from the .PHONY target list and has been
> verified to work with various flavors and builds of make-3.81 against NFS,
> ext2fs, ext3fs and tmpfs file systems.

that statement is incorrect.  the version file is supposed to be checked 
everytime you run make as it depends on a whole lot of information which 
cannot be expressed in the makefile.  thus it needs to be a PHONY.

the latest git tree does the right thing: it doesnt actually replace the file 
unless it has changed which means nothing else will get regenerated unless 
the file actually changes.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080412/351356a8/attachment.pgp 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] Remove $(VERSION_FILE) from PHONY Target List
  2008-04-12 19:29 ` Mike Frysinger
@ 2008-04-13  6:20   ` Grant Erickson
  2008-04-13  6:43     ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Erickson @ 2008-04-13  6:20 UTC (permalink / raw)
  To: u-boot

On 4/12/08 12:29 PM, Mike Frysinger wrote:
> On Friday 11 April 2008, Grant Erickson wrote:
>> When building against non-local, non-disk-backed file systems (e.g. NFS,
>> tmpfs), the u-boot build can iterate forever, attempting to re-generate
>> "include/autoconf.mk". This occurs because $(VERSION_FILE) (aka
>> ${ROOT}/u-boot/build/include/version_autogenerated.h) is always regarded as
>> out-of-date because it is in the .PHONY target list, even though it's a
>> real file and seems to need to be only created once and only once.
>> 
>> This patch removes $(VERSION_FILE) from the .PHONY target list and has been
>> verified to work with various flavors and builds of make-3.81 against NFS,
>> ext2fs, ext3fs and tmpfs file systems.
> 
> that statement is incorrect.  the version file is supposed to be checked
> everytime you run make as it depends on a whole lot of information which
> cannot be expressed in the makefile.  thus it needs to be a PHONY.
> 
> the latest git tree does the right thing: it doesnt actually replace the file
> unless it has changed which means nothing else will get regenerated unless
> the file actually changes.
> -mike

Mike,

Thanks for following up. The hypothesis (i.e. the version file is supposed
to be checked) is well supported by the code; however, the latest git code
as it stands neither seems to support the conclusion--namely $(VERSION_FILE)
should be in the PHONY target list--nor that it depends on a whole lot of
information. The contents of the file are simply:

    % cat include/version_autogenerated.h
    #define U_BOOT_VERSION "U-Boot 1.3.2"

and the only thing $(VERSION_FILE) depends on, implicitly, is the Makefile
itself.

At this point, the discussion is academic since, happily, the patch has been
implicitly accepted by token of already being in git and, presumably, 1.3.3
when it emerges.

Best,

Grant

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] Remove $(VERSION_FILE) from PHONY Target List
  2008-04-13  6:20   ` Grant Erickson
@ 2008-04-13  6:43     ` Mike Frysinger
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2008-04-13  6:43 UTC (permalink / raw)
  To: u-boot

On Sunday 13 April 2008, Grant Erickson wrote:
> On 4/12/08 12:29 PM, Mike Frysinger wrote:
> > On Friday 11 April 2008, Grant Erickson wrote:
> >> When building against non-local, non-disk-backed file systems (e.g. NFS,
> >> tmpfs), the u-boot build can iterate forever, attempting to re-generate
> >> "include/autoconf.mk". This occurs because $(VERSION_FILE) (aka
> >> ${ROOT}/u-boot/build/include/version_autogenerated.h) is always regarded
> >> as out-of-date because it is in the .PHONY target list, even though it's
> >> a real file and seems to need to be only created once and only once.
> >>
> >> This patch removes $(VERSION_FILE) from the .PHONY target list and has
> >> been verified to work with various flavors and builds of make-3.81
> >> against NFS, ext2fs, ext3fs and tmpfs file systems.
> >
> > that statement is incorrect.  the version file is supposed to be checked
> > everytime you run make as it depends on a whole lot of information which
> > cannot be expressed in the makefile.  thus it needs to be a PHONY.
> >
> > the latest git tree does the right thing: it doesnt actually replace the
> > file unless it has changed which means nothing else will get regenerated
> > unless the file actually changes.
>
> Thanks for following up. The hypothesis (i.e. the version file is supposed
> to be checked) is well supported by the code; however, the latest git code
> as it stands neither seems to support the conclusion--namely
> $(VERSION_FILE) should be in the PHONY target list--nor that it depends on
> a whole lot of information. The contents of the file are simply:
>
>     % cat include/version_autogenerated.h
>     #define U_BOOT_VERSION "U-Boot 1.3.2"
>
> and the only thing $(VERSION_FILE) depends on, implicitly, is the Makefile
> itself.

reading only the output leads to false conclusions such as this.  read the 
actual source code and you'll see that the version string can contain dynamic 
information via shell scripts which cannot be expressed in make syntax.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080413/fdbb21d6/attachment.pgp 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] Remove $(VERSION_FILE) from PHONY Target List
  2008-04-11 20:36 [U-Boot-Users] [PATCH] Remove $(VERSION_FILE) from PHONY Target List Grant Erickson
  2008-04-12 19:29 ` Mike Frysinger
@ 2008-05-09  8:22 ` Wolfgang Denk
  2008-05-09 16:00   ` Grant Erickson
  1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2008-05-09  8:22 UTC (permalink / raw)
  To: u-boot

In message <C42519C4.E8EE%gerickson@nuovations.com> you wrote:
> When building against non-local, non-disk-backed file systems (e.g. NFS,
> tmpfs), the u-boot build can iterate forever, attempting to re-generate
> "include/autoconf.mk". This occurs because $(VERSION_FILE) (aka
> ${ROOT}/u-boot/build/include/version_autogenerated.h) is always regarded as
> out-of-date because it is in the .PHONY target list, even though it's a real
> file and seems to need to be only created once and only once.
> 
> This patch removes $(VERSION_FILE) from the .PHONY target list and has been
> verified to work with various flavors and builds of make-3.81 against NFS,
> ext2fs, ext3fs and tmpfs file systems.
> 
> More detail at:
> 
> http://sourceforge.net/mailarchive/message.php?msg_id=C4180895.E556%25gerick
> son%40nuovations.com

This may fix your immediate problem, but it is wrong. Assume you have
built U-Boot from some specific version, then the git commit ID  will
be  shown  as  part of the version string. Assume you now edit a file
and run "make" again. The intention is that this new build shows  the
"-dirty" marker in the version string, plus the new build date.

Your change breaks this behaviour.

I just  posted  another  patch:  ``Avoid  infinite  loop  "Generating
include/autoconf.mk" '' which is supposed to fix the problem, without
unwanted side effects.

Please test.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The more data I punch in this card,  the lighter it becomes, and the
lower the mailing cost."
                     - Stan Kelly-Bootle, "The Devil's DP Dictionary"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] [PATCH] Remove $(VERSION_FILE) from PHONY Target List
  2008-05-09  8:22 ` Wolfgang Denk
@ 2008-05-09 16:00   ` Grant Erickson
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Erickson @ 2008-05-09 16:00 UTC (permalink / raw)
  To: u-boot

On 5/9/08 1:22 AM, Wolfgang Denk wrote:
> In message <C42519C4.E8EE%gerickson@nuovations.com> you wrote:
>> When building against non-local, non-disk-backed file systems (e.g. NFS,
>> tmpfs), the u-boot build can iterate forever, attempting to re-generate
>> "include/autoconf.mk". This occurs because $(VERSION_FILE) (aka
>> ${ROOT}/u-boot/build/include/version_autogenerated.h) is always regarded as
>> out-of-date because it is in the .PHONY target list, even though it's a real
>> file and seems to need to be only created once and only once.
>> 
>> This patch removes $(VERSION_FILE) from the .PHONY target list and has been
>> verified to work with various flavors and builds of make-3.81 against NFS,
>> ext2fs, ext3fs and tmpfs file systems.
>> 
>> More detail at:
>> 
>> http://sourceforge.net/mailarchive/message.php?msg_id=C4180895.E556%25gerick
>> son%40nuovations.com
> 
> This may fix your immediate problem, but it is wrong. Assume you have
> built U-Boot from some specific version, then the git commit ID  will
> be  shown  as  part of the version string. Assume you now edit a file
> and run "make" again. The intention is that this new build shows  the
> "-dirty" marker in the version string, plus the new build date.
> 
> Your change breaks this behaviour.
> 
> I just  posted  another  patch:  ``Avoid  infinite  loop  "Generating
> include/autoconf.mk" '' which is supposed to fix the problem, without
> unwanted side effects.
> 
> Please test.

Wolfgang,

This patch works effectively and successfully when tested against NFSv3,
EXT2, EXT3 and TMPFS file systems with make v3.79, v.3.80 and v3.81.

Thanks,

Grant

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-05-09 16:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-11 20:36 [U-Boot-Users] [PATCH] Remove $(VERSION_FILE) from PHONY Target List Grant Erickson
2008-04-12 19:29 ` Mike Frysinger
2008-04-13  6:20   ` Grant Erickson
2008-04-13  6:43     ` Mike Frysinger
2008-05-09  8:22 ` Wolfgang Denk
2008-05-09 16:00   ` Grant Erickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox