Makefile.autotools.in does not work well with projects
The Makefile.autotools.in uses a rule which touches a stamp_target_installed file, this does not work well with projects.
The Makefile should depend on a file on the target root file system, file not there => install to target again.
Signature · 2 lines
With kind regards, Hans-Christian Egtvedt, Applications Engineer
Quoted 5 lines · Hans-Christian Egtvedt
The Makefile.autotools.in uses a rule which touches a
stamp_target_installedfile, this does not work well with projects.The
Makefileshould depend on a file on the target root file system, file not there => install to target again.
Indeed - install stamps are pure evil. They don't work with multiple projects and they mean you can't "rm -rf project_build_$(ARCH)/$(PROJECT)/root".
Hamish
Signature · 1 line
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
[Buildroot] Makefile.autotools.in does not work wellwith projects
Subject: Re: [Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 12 lines · Hans-Christian Egtvedt
Quoted 5 lines
The Makefile.autotools.in uses a rule which touches a
stamp_target_installedfile, this does not work well with projects.The
Makefileshould depend on a file on the target root file system, file not there => install to target again.Indeed - install stamps are pure evil. They don't work with multiple projects and they mean you can't "rm -rf project_build_$(ARCH)/$(PROJECT)/root".
I do not think that you want to have install stamps in the root file system because they will end up in the target (unless they are ignored when the rootfs is created).
You could have install stamps in a "project_build_$(ARCH)/$(PROJECT)/.stamps"
directory. Of course you would have to remember to delete this directory when you delete "project_build_$(ARCH)/$(PROJECT)/root"
Best Regards
Ulf Samuelsson
[Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 11 lines · Ulf Samuelsson
Subject: Re: [Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 7 lines · Hans-Christian Egtvedt
Quoted 5 lines
The Makefile.autotools.in uses a rule which touches a
stamp_target_installedfile, this does not work well with projects.The
Makefileshould depend on a file on the target root file system, file not there => install to target again.
Quoted 7 lines
Quoted 3 lines
Indeed - install stamps are pure evil. They don't work with multiple projects and they mean you can't "rm -rf project_build_$(ARCH)/$(PROJECT)/root".
I do not think that you want to have install stamps in the root file system because they will end up in the target (unless they are ignored when the rootfs is created).
I don't think you should use stamps at all - test for a target file instead.
Hamish
Signature · 1 line
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
[Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 16 lines · Hamish Moffatt
Quoted 15 lines · Ulf Samuelsson
Subject: Re: [Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 10 lines · Hans-Christian Egtvedt
Quoted 5 lines
The Makefile.autotools.in uses a rule which touches a
stamp_target_installedfile, this does not work well with projects.The
Makefileshould depend on a file on the target root file system, file not there => install to target again.Indeed - install stamps are pure evil. They don't work with multiple projects and they mean you can't "rm -rf project_build_$(ARCH)/$(PROJECT)/root".
Quoted 7 lines
Quoted 3 lines
I do not think that you want to have install stamps in the root file system because they will end up in the target (unless they are ignored when the rootfs is created).
I don't think you should use stamps at all - test for a target file instead.
Yes, something in the order of a must defined variable pointing to $(TARGET_DIR)/$(FOO_TARGET_INSTALLED_FILE) ?
I tried jugling the Makefile magic, but I was not able to generate a nice dotfile in the $(PROJECT_BUILD_DIR). See the patch below, 0.02 ? to anybody who can spot what I do wrong.
Signature · 9 lines
With kind regards, Hans-Christian Egtvedt, Applications Engineer -------------- next part -------------- A non-text attachment was scrubbed... Name: makefile-autotools-in.patch Type: text/x-patch Size: 1889 bytes Desc: not available Url : http://busybox.net/lists/buildroot/attachments/20080728/9659faa4/attachment.bin
[Buildroot] Makefile.autotools.in does not work wellwith projects
In reply to Hamish MoffattQuoted 15 lines · Hamish Moffatt
Quoted 14 lines · Ulf Samuelsson
Subject: Re: [Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 10 lines · Hans-Christian Egtvedt
Quoted 5 lines
The Makefile.autotools.in uses a rule which touches a
stamp_target_installedfile, this does not work well with projects.The
Makefileshould depend on a file on the target root file system, file not there => install to target again.Indeed - install stamps are pure evil. They don't work with multiple projects and they mean you can't "rm -rf project_build_$(ARCH)/$(PROJECT)/root".
Quoted 7 lines
Quoted 3 lines
I do not think that you want to have install stamps in the root file system because they will end up in the target (unless they are ignored when the rootfs is created).
I don't think you should use stamps at all - test for a target file instead.
And two minutes later I have a RFC for this solution, see attached patch.
Signature · 9 lines
With kind regards, Hans-Christian Egtvedt, Applications Engineer -------------- next part -------------- A non-text attachment was scrubbed... Name: makefile-autotools-in.patch Type: text/x-patch Size: 1493 bytes Desc: not available Url : http://busybox.net/lists/buildroot/attachments/20080728/5703bd59/attachment.bin
[Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 25 lines · Hans-Christian Egtvedt
Quoted 15 lines · Hamish Moffatt
Quoted 14 lines · Ulf Samuelsson
Subject: Re: [Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 10 lines · Hans-Christian Egtvedt
Quoted 5 lines
The Makefile.autotools.in uses a rule which touches a
stamp_target_installedfile, this does not work well with projects.The
Makefileshould depend on a file on the target root file system, file not there => install to target again.Indeed - install stamps are pure evil. They don't work with multiple projects and they mean you can't "rm -rf project_build_$(ARCH)/$(PROJECT)/root".
Quoted 6 lines
Quoted 3 lines
I do not think that you want to have install stamps in the root file system because they will end up in the target (unless they are ignored when the rootfs is created).
I don't think you should use stamps at all - test for a target file instead.
And two minutes later I have a RFC for this solution, see attached patch.
[..]
Quoted 6 lines
# Install to target dir
-$(BUILD_DIR)/%/.stamp_target_installed:
+$(TARGET_DIR)/%/$($($(PKG)_NAME)_TARGET_INSTALLED_TOUCH_FILE):(quoted diff) +1
-1$(call MESSAGE,"Installing to target") - $($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_INSTALL_TARGET_OPT) -C $(@D)/$($(PKG)_SUBDIR) + $($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_INSTALL_TARGET_OPT) -C $($(PKG)_DIR)/$($(PKG)_SUBDIR)
[..]
Quoted 3 lines
# define sub-target stamps -$(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed +$(2)_TARGET_INSTALL_TARGET = $$(TARGET_DIR)/$$($(2)_TARGET_INSTALLED_TOUCH_FILE)
Will every package that uses Makefile.autotools.in need to be modified to define the target installed file? If so, would you like to prepare a large patch? :) Alternatively, perhaps $(2)_TARGET_INSTALL_TARGET could be fall back to the old definition if the new variable is not supplied, using some ifeq logic.
Thanks for working on this!
Hamish
Signature · 1 line
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
[Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 2 lines · Hamish Moffatt
Quoted 1 line · Hans-Christian Egtvedt
On Sun, 2008-07-27 at 11:33 +1000, Hamish Moffatt wrote:
<snipp>
Quoted 10 lines
Quoted 2 lines
And two minutes later I have a RFC for this solution, see attached patch.
[..]
Quoted 6 lines
# Install to target dir
-$(BUILD_DIR)/%/.stamp_target_installed:
+$(TARGET_DIR)/%/$($($(PKG)_NAME)_TARGET_INSTALLED_TOUCH_FILE):(quoted diff) +1
-1$(call MESSAGE,"Installing to target") - $($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_INSTALL_TARGET_OPT) -C $(@D)/$($(PKG)_SUBDIR) + $($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_INSTALL_TARGET_OPT) -C $($(PKG)_DIR)/$($(PKG)_SUBDIR)[..]
Quoted 7 lines
Quoted 3 lines
# define sub-target stamps -$(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed +$(2)_TARGET_INSTALL_TARGET = $$(TARGET_DIR)/$$($(2)_TARGET_INSTALLED_TOUCH_FILE)Will every package that uses Makefile.autotools.in need to be modified to define the target installed file? If so, would you like to prepare a large patch? :)
Not really, since I do not have knowledge about each package and what they will need to depend on installed on target.
Quoted 4 lines
Alternatively, perhaps $(2)_TARGET_INSTALL_TARGET could
be fall back to the old definition if the new variable is not supplied, using some ifeq logic.
Yes, there should be a fallback when the variable is not supplied. The Makefile should print a warning message as well, demanding an update ;)
I'll see what I can figure out.
Signature · 2 lines
With kind regards, Hans-Christian Egtvedt, Applications Engineer
[Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 32 lines · Hans-Christian Egtvedt
Quoted 2 lines · Hamish Moffatt
Quoted 1 line · Hans-Christian Egtvedt
On Sun, 2008-07-27 at 11:33 +1000, Hamish Moffatt wrote:
<snipp>
Quoted 10 lines
Quoted 2 lines
And two minutes later I have a RFC for this solution, see attached patch.
[..]
Quoted 6 lines
# Install to target dir
-$(BUILD_DIR)/%/.stamp_target_installed:
+$(TARGET_DIR)/%/$($($(PKG)_NAME)_TARGET_INSTALLED_TOUCH_FILE):(quoted diff) +1
-1$(call MESSAGE,"Installing to target") - $($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_INSTALL_TARGET_OPT) -C $(@D)/$($(PKG)_SUBDIR) + $($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_INSTALL_TARGET_OPT) -C $($(PKG)_DIR)/$($(PKG)_SUBDIR)[..]
Quoted 7 lines
Quoted 3 lines
# define sub-target stamps -$(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed +$(2)_TARGET_INSTALL_TARGET = $$(TARGET_DIR)/$$($(2)_TARGET_INSTALLED_TOUCH_FILE)Will every package that uses Makefile.autotools.in need to be modified to define the target installed file? If so, would you like to prepare a large patch? :)
Not really, since I do not have knowledge about each package and what they will need to depend on installed on target.
Quoted 4 lines
Alternatively, perhaps $(2)_TARGET_INSTALL_TARGET could
be fall back to the old definition if the new variable is not supplied, using some ifeq logic.
Quoted 4 lines
Yes, there should be a fallback when the variable is not supplied. The
Makefileshould print a warning message as well, demanding an update ;)I'll see what I can figure out.
Let me suggest to rename that variable to $(2)_TARGET_FILES and do
$(2)_TARGET_INSTALL_TARGET = $(firstword $($(2)_TARGET_FILES))
foo_tmp=$(firstword $($(2)_TARGET_FILES))
or somthing like $(if $(foo_tmp),$(foo_tmp),$($(2).old_stamp_file))
Reasoning:
You really want to only have a few files in $(TARGET_DIR) as opposed to $(STAGING_DIR). Those $(2)_TARGET_FILES should ideally be the only files installed into the final image (think of a gazillion superfluous termcap entries or other unneeded files).
[Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 42 lines · Bernhard Fischer
Quoted 32 lines · Hans-Christian Egtvedt
Quoted 2 lines · Hamish Moffatt
Quoted 1 line · Hans-Christian Egtvedt
On Sun, 2008-07-27 at 11:33 +1000, Hamish Moffatt wrote:
<snipp>
Quoted 10 lines
Quoted 2 lines
And two minutes later I have a RFC for this solution, see attached patch.
[..]
Quoted 6 lines
# Install to target dir
-$(BUILD_DIR)/%/.stamp_target_installed:
+$(TARGET_DIR)/%/$($($(PKG)_NAME)_TARGET_INSTALLED_TOUCH_FILE):(quoted diff) +1
-1$(call MESSAGE,"Installing to target") - $($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_INSTALL_TARGET_OPT) -C $(@D)/$($(PKG)_SUBDIR) + $($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_INSTALL_TARGET_OPT) -C $($(PKG)_DIR)/$($(PKG)_SUBDIR)[..]
Quoted 7 lines
Quoted 3 lines
# define sub-target stamps -$(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed +$(2)_TARGET_INSTALL_TARGET = $$(TARGET_DIR)/$$($(2)_TARGET_INSTALLED_TOUCH_FILE)Will every package that uses Makefile.autotools.in need to be modified to define the target installed file? If so, would you like to prepare a large patch? :)
Not really, since I do not have knowledge about each package and what they will need to depend on installed on target.
Quoted 4 lines
Alternatively, perhaps $(2)_TARGET_INSTALL_TARGET could
be fall back to the old definition if the new variable is not supplied, using some ifeq logic.Quoted 4 lines
Yes, there should be a fallback when the variable is not supplied. The
Makefileshould print a warning message as well, demanding an update ;)I'll see what I can figure out.
Let me suggest to rename that variable to $(2)_TARGET_FILES and do
$(2)_TARGET_INSTALL_TARGET = $(firstword $($(2)_TARGET_FILES))
Quoted 8 lines
foo_tmp=$(firstword $($(2)_TARGET_FILES))
or somthing like $(if $(foo_tmp),$(foo_tmp),$($(2).old_stamp_file))Reasoning:
You really want to only have a few files in $(TARGET_DIR) as opposed to $(STAGING_DIR). Those $(2)_TARGET_FILES should ideally be the only files installed into the final image (think of a gazillion superfluous termcap entries or other unneeded files).
Then you need to overwrite the install rule anyway, my patch was intended to fix the general installation of applications.
You seem to want a rule which will install only the binaries needed?
Some applications and libraries are actually installed quite minimal and correct by using make DESTDIR install :)
Signature · 2 lines
With kind regards, Hans-Christian Egtvedt, Applications Engineer
[Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 13 lines · Hans-Christian Egtvedt
Quoted 4 lines
Let me suggest to rename that variable to $(2)_TARGET_FILES and do
$(2)_TARGET_INSTALL_TARGET = $(firstword $($(2)_TARGET_FILES))Quoted 8 lines
foo_tmp=$(firstword $($(2)_TARGET_FILES))
or somthing like $(if $(foo_tmp),$(foo_tmp),$($(2).old_stamp_file))Reasoning:
You really want to only have a few files in $(TARGET_DIR) as opposed to $(STAGING_DIR). Those $(2)_TARGET_FILES should ideally be the only files installed into the final image (think of a gazillion superfluous termcap entries or other unneeded files).
Quoted 4 lines
Then you need to overwrite the install rule anyway, my patch was intended to fix the general installation of applications.
You seem to want a rule which will install only the binaries needed?
Yes. Ideally only the needed files should end on the target.
Quoted 3 lines
Some applications and libraries are actually installed quite minimal and correct by using make DESTDIR install :)
true, but for those who don't, such target files should be used.
[Buildroot] Makefile.autotools.in does not work wellwith projects
Quoted 15 lines · Bernhard Fischer
Quoted 13 lines · Hans-Christian Egtvedt
Quoted 12 lines
Let me suggest to rename that variable to $(2)_TARGET_FILES and do
$(2)_TARGET_INSTALL_TARGET = $(firstword $($(2)_TARGET_FILES))foo_tmp=$(firstword $($(2)_TARGET_FILES))
or somthing like $(if $(foo_tmp),$(foo_tmp),$($(2).old_stamp_file))Reasoning:
You really want to only have a few files in $(TARGET_DIR) as opposed to $(STAGING_DIR). Those $(2)_TARGET_FILES should ideally be the only files installed into the final image (think of a gazillion superfluous termcap entries or other unneeded files).
Quoted 6 lines
Quoted 4 lines
Then you need to overwrite the install rule anyway, my patch was intended to fix the general installation of applications.
You seem to want a rule which will install only the binaries needed?
Yes. Ideally only the needed files should end on the target.
My patch was intended to fix a bug/problem with the Makefile.autotools.in, while your suggestion is more an enhancement.
It is indeed nice to have a list of files to install, but my patch does not try to solve that problem.
I do not think it is strait forward to solve your suggestion either.
Quoted 5 lines
Quoted 3 lines
Some applications and libraries are actually installed quite minimal and correct by using make DESTDIR install :)
true, but for those who don't, such target files should be used.
The install to target rule also strips away any installed header files, man pages and doc if you select to not have header files on target. So it is quite sane for most packages.
Signature · 2 lines
With kind regards, Hans-Christian Egtvedt, Applications Engineer