On 04/28/2011 12:49 PM, John Zavgren wrote:
Emmanuel:

Thanks for getting back to me on this issue. I haven't tried your suggestions yet, however, I wonder why similar packages that don't have the modifications you recommend seem to work they way I expect them to.

For example, the package that installs the bridge utiliites: package/bridge-utils/, has a Makefile that looks like this:

<snip>

I will be honest: I have some issue to find my way in the include/*.mk files. I even might have been wrong (although adding this simple line helped me to correct similar situations).

What I can read from the openwrt makefiles (and I may misintrepret them ; they are not that easy to follow):

* PKG_INSTALL controls the execution of "make -C yourbuilddir install" during the package compilation (ie it executes make -C builddir && make -C builddir install if PKG_INSTALL is defined). So effectively, it is not related to your issue.

* BuildTarget/ipkg (in include/package-ipkg.mk) adds the compile rule, which depends on whether Package/xxx/install is defined or not:

    ifdef Package/$(1)/install
      ifneq ($(CONFIG_PACKAGE_$(1))$(SDK)$(DEVELOPER),)
        compile: $$(IPKG_$(1)) $(STAGING_DIR_ROOT)/stamp/.$(1)_installed

        ifeq ($(CONFIG_PACKAGE_$(1)),y)
          install: $$(INFO_$(1))
        endif
      else
        compile: $(1)-disabled
        $(1)-disabled:
        @echo "WARNING: skipping $(1) -- package not selected"
      endif
    endif

The dependant rules are:

   $(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(STAMP_BUILT)
    rm -rf $(STAGING_DIR_ROOT)/tmp-$(1)
    mkdir -p $(STAGING_DIR_ROOT)/stamp $(STAGING_DIR_ROOT)/tmp-$(1)
    $(call Package/$(1)/install,$(STAGING_DIR_ROOT)/tmp-$(1))
    $(call Package/$(1)/install_lib,$(STAGING_DIR_ROOT)/tmp-$(1))
    $(CP) $(STAGING_DIR_ROOT)/tmp-$(1)/. $(STAGING_DIR_ROOT)/
    rm -rf $(STAGING_DIR_ROOT)/tmp-$(1)
    touch $$@

    $$(IPKG_$(1)): $(STAMP_BUILT)
    (do a bunch of stuff to generate the final package)

Thus, the conditions to have the Package/XXX/install rule executed is to have:

* CONFIG_PACKAGE_XXX set to y (<*>)
* An existing Package/XXX/install (obvious)

And the condition to have your own install rule executed dring compilation is:

* define PKG_INSTALL in the package Makefile

Build/InstallDev is called from the moment it is defined (right after compilation).

Best regards,

-- Emmanuel


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to