Skip to contentSkip to conversation

Remove $(VERSION_FILE) from PHONY Target List

PATCH New Grant Erickson 3 participants 6 messages Apr 11, 2008 – May 9, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove $(VERSION_FILE) from PHONY Target List

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

---

Makefile +0 -0
index e5b4210..50069b7 100644
@@ -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
#1 lore raw

PATCH 1/1 Remove $(VERSION_FILE) from PHONY Target List

Quoted 10 lines · Grant Erickson

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

#2 lore raw

PATCH 1/1 Remove $(VERSION_FILE) from PHONY Target List

Quoted 12 lines · Mike Frysinger
Quoted 10 lines · Grant Erickson

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.

Quoted 8 lines

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

#3 lore raw

PATCH 1/1 Remove $(VERSION_FILE) from PHONY Target List

Quoted 27 lines · Grant Erickson
Quoted 12 lines · Mike Frysinger
Quoted 10 lines · Grant Erickson

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.

Quoted 7 lines

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:

Quoted 5 lines

% 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

#4 lore raw

PATCH 1/1 Remove $(VERSION_FILE) from PHONY Target List

In reply to Grant Erickson
Quoted 7 lines · In message <C42519C4.E8EE%[email protected]> 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.

Quoted 8 lines

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

Signature · 6 lines
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"
#5 lore raw

PATCH 1/1 Remove $(VERSION_FILE) from PHONY Target List

Quoted 23 lines · Wolfgang Denk
Quoted 7 lines · In message <C42519C4.E8EE%[email protected]> 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.

Quoted 8 lines

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.

Quoted 7 lines

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