簡體   English   中英

具有自定義編譯定義的Openwrt Makefile無法執行

[英]Openwrt Makefile with custom compile definition does not get executed

我試圖獲得一個自定義的編譯定義,以使“ make install”與“ make install”分開,但是自定義定義Build/compile從未執行。

define Build/compile
  echo -e "\e[1;34m \nBuild/compile $(PKG_NAME)\n $<\e[0m" \
  $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR) \
  DESTDIR="$(PKG_INSTALL_DIR)"
endef

當執行時,它不起作用: make -j1 V=s package/network/nodejs/node/compile

但准備步驟有效:

define Build/Prepare
  echo -e "\e[1;34m \nBuild/Prepare $(PKG_NAME)\n $<\e[0m"
endef

當執行以下命令時: make -j1 V=s package/network/nodejs/node/prepare

因此,請您幫忙找出以下腳本出了什么問題:

        #
        # Copyright (C) 2007-2011 OpenWrt.org
        #
        # This is free software, licensed under the GNU General Public License v2.
        # See /LICENSE for more information.
        #

        include $(TOPDIR)/rules.mk

        PKG_NAME:=nodejs
        PKG_VERSION:=0.12.7
        PKG_RELEASE:=0

        PKG_SOURCE:=node-v$(PKG_VERSION).tar.gz
        PKG_SOURCE_URL:=https://nodejs.org/dist/v$(PKG_VERSION)/
        PKG_MD5SUM:=5523ec4347d7fe6b0f6dda1d1c7799d5

        PKG_BUILD_DEPENDS:=nodejs/host

        HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/node-v$(PKG_VERSION)
        PKG_BUILD_DIR:=$(BUILD_DIR)/node-v$(PKG_VERSION)
        #PKG_INSTALL:=1
        PKG_BUILD_PARALLEL:=1

        include $(INCLUDE_DIR)/host-build.mk
        include $(INCLUDE_DIR)/package.mk

        define Package/nodejs
        SUBMENU:=Node.js
        SECTION:=net
        CATEGORY:=Network
        TITLE:=Node.js Evented I/O for V8 JavaScript
        URL:=http://nodejs.org
        MAINTAINER:=Xin Ouyang <xinpascal@gmail.com>
        DEPENDS:=@armeb||@arm||@i386 +libstdcpp +libpthread +librt +libopenssl +uclibcxx
        endef

        define Package/nodejs/description
        Node.js is a platform built on Chrome's JavaScript runtime for easily
        building fast, scalable network applications. Node.js uses an event-driven,
        non-blocking I/O model that makes it lightweight and efficient, perfect
        for data-intensive real-time applications that run across distributed
        devices.
        endef

        define Package/nodejs-npm
        SUBMENU:=Node.js
        SECTION:=net
        CATEGORY:=Network
        TITLE:=Node Package Manager
        URL:=https://npmjs.org
        MAINTAINER:=Xin Ouyang <xinpascal@gmail.com>
        DEPENDS:=@armeb||@arm||@i386 +libstdcpp +libpthread +librt +libopenssl +uclibcxx
        endef

        define Package/nodejs-npm/description
        npm is the package manager for the Node JavaScript platform. It puts
        modules in place so that node can find them, and manages dependency
        conflicts intelligently.
        endef

        #We need to override all args becouse they are not compatible with the build script
        CONFIGURE_ARGS:=
        HOST_CONFIGURE_ARGS:=
        HOST_CONFIGURE_CMD:=$(HOST_CONFIGURE_VARS) ./configure  --without-snapshot ;
        CONFIGURE_ARGS:= --without-snapshot
        #HOST_CONFIGURE_ARGS:=
        HOST_MAKE_FLAGS += 
            BUILDTYPE=Release i18nsupport=off

        define Build/Prepare
        echo -e "\e[1;34m \nBuild/Prepare $(PKG_NAME)\n $<\e[0m"
        endef

        define Build/nodejs/Compile
        echo -e "\e[1;34m \n  Build/Compile $(PKG_NAME)    \n $<\e[0m"
        endef


        define Build/compile
        echo -e "\e[1;34m \nBuild/compile $(PKG_NAME)\n $<\e[0m" \
            $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR) \
        DESTDIR="$(PKG_INSTALL_DIR)"
        endef

        define Package/nodejs/install
        echo -e "\e[1;34m \nBuild/install $(PKG_NAME)\n $<\e[0m" \
            $(MAKE) $(MAKE_FLAGS) -C $(PKG_BUILD_DIR) install DESTDIR=$(PKG_INSTALL_DIR)
            $(INSTALL_DIR) $(1)/usr/bin
            $(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/node
        endef

        define Package/nodejs-npm/install
            $(INSTALL_DIR) $(1)/usr/bin
            $(CP) $(PKG_INSTALL_DIR)/usr/bin/npm $(1)/usr/bin/npm
            $(INSTALL_DIR) $(1)/usr/lib/node_modules
            $(CP) -r $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/ \
                $(1)/usr/lib/node_modules
        endef

        #define Build/InstallDev
        #   $(INSTALL_DIR) $(1)/usr/share/nodejs-src
        #   $(CP) $(PKG_BUILD_DIR)/* $(1)/usr/share/nodejs-src
        #endef

        $(eval $(call HostBuild))
        $(eval $(call BuildPackage,nodejs))
        $(eval $(call BuildPackage,nodejs-npm))

它應該是Build/Compile ,而不是compile (大寫C)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM