简体   繁体   English

更改openwrt编译包的默认目录src

[英]Change default directory src for openwrt compiling package

I'm creating a package for openwrt that contains several modules.我正在为 openwrt 创建一个包含多个模块的包。 The package compiles right if the structure is:如果结构是:

package_name
. Makefile<s>.txt</s>
. files
. src
    + CMakeLists.txt
    + Module1
    + Module2
    + ...
    + Modulen

But if I change the name src by modules it shows me errors.但是如果我通过模块更改名称src它会显示错误。 I know the default structure search for src directory, but, what should I add to my Makefile.txt to change default value src to any other one?我知道 src 目录的默认结构搜索,但是,我应该向我的 Makefile.txt 添加什么以将默认值 src 更改为任何其他值?

Thank you.谢谢你。

The OpenWRt package structure can be found here .可以在此处找到OpenWRt 包结构。 The interresting part for you is Bundle source code with OpenWrt Makefile .对您来说有趣的部分是Bundle source code with OpenWrt Makefile

(I am afraid the Makefile should be just Makefile without txt extension. It would be helpful if you could post your complete Makefile - but I will try without it. Also please indicate the OpenWRT version you are using, the answer can be version-dependent) (我担心Makefile应该只是没有txt扩展名的Makefile 。如果您能发布完整的 Makefile 会很有帮助 - 但我会尝试不使用它。另外请指明您使用的 OpenWRT 版本,答案可能取决于版本)

I have found in include/package-defaults.mk the following [OpenWRT 19.07.1]:我在include/package-defaults.mk发现了以下 [OpenWRT 19.07.1]:

Build/Patch:=$(Build/Patch/Default)
ifneq ($(strip $(PKG_UNPACK)),)
  define Build/Prepare/Default
        $(PKG_UNPACK)
        [ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
        $(Build/Patch)
  endef
endif

This means to me, that either you:这对我来说意味着,要么你:

  • define PKG_UNPACK in your Makefile as follows: PKG_UNPACK=$(CP) ./modules/. $(PKG_BUILD_DIR)在你的 Makefile 中定义PKG_UNPACK如下: PKG_UNPACK=$(CP) ./modules/. $(PKG_BUILD_DIR) PKG_UNPACK=$(CP) ./modules/. $(PKG_BUILD_DIR)
  • override default Prepare section as follows (or copy recursive, depending on your structure):如下覆盖默认准备部分(或复制递归,取决于您的结构):

. .

define Build/Prepare
        $(call Build/Prepare/Default)
        $(CP) ./modules/* $(PKG_BUILD_DIR)/
endef

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM