When files in the projectroot directory are being used and installed via
install_alternative() then there are no dependencies to these files.
This is annoying when a file in projectroot is being edited but not
installed in the target image when ptxdist go is executed.

This change adds a file to store the dependencies per package and include
them in the top-level makefile

Signed-off-by: Remy Bohmer <li...@bohmer.net>
---
This patch is not finished yet and I am curious if this is the right
way to solve it. At least it still has the problem that the deps file
keeps on growing and is never cleared. Everytime when, for example,
the bbinit-method.targetinstall stage is executed the deps file is
appended with the same dependencies. But: at least it works better
then without it...

 rules/other/Toplevel.make |    6 ++++++
 rules/post/install.make   |    4 ++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/rules/other/Toplevel.make b/rules/other/Toplevel.make
index d270e71..5565efd 100644
--- a/rules/other/Toplevel.make
+++ b/rules/other/Toplevel.make
@@ -94,6 +94,12 @@ ifneq ($(wildcard $(PROJECTPOSTRULESDIR)/*.make),)
 include $(wildcard $(PROJECTPOSTRULESDIR)/*.make)
 endif
 
+# install_alternative has some configuration defined dependencies. include them
+# if these exist.
+ifneq ($(wildcard $(STATEDIR)/*.alt_deps),)
+include $(wildcard $(STATEDIR)/*.alt_deps)
+endif
+
 # ----------------------------------------------------------------------------
 # just the "print" target
 # ----------------------------------------------------------------------------
diff --git a/rules/post/install.make b/rules/post/install.make
index 3a86afe..48bd882 100644
--- a/rules/post/install.make
+++ b/rules/post/install.make
@@ -136,6 +136,9 @@ install_copy =                                              
                                        \
 # This macro first looks in $(PTXDIST_WORKSPACE)/projectroot for the file to 
copy and then
 # in $(PTXDIST_TOPDIR)/generic and installs the file under $(ROOTDIR)
 #
+# Since the dependency to the source files is dynamic we store the dependency 
information
+# in a dependency file that can be included in the make files itself.
+#
 # $1: packet label
 # $2: UID
 # $3: GID
@@ -176,6 +179,7 @@ install_alternative =                                       
                                \
                echo "Error: install_alternative failed!";                      
        \
                exit 1;                                                         
        \
        fi;                                                                     
        \
+       echo "$@: $$SRC" >> $(STATEDIR)/$$PACKET.alt_deps;                      
        \
        mkdir -p $(PKGDIR)/$$PACKET.tmp;                                        
        \
        echo "f:$$FILE:$$OWN:$$GRP:$$PER" >> $(STATEDIR)/$$PACKET.perms;
 
-- 
1.6.3.3


--
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to