[U-Boot-Users] [PATCH] 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
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

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

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

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

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

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
participants (3)
-
Grant Erickson
-
Mike Frysinger
-
Wolfgang Denk