Question about makefile

ciao!

how are you?
this is weird, i am trying ot build node chakra, but it tries to build build_dir/target-arm_cortex-a9+vfpv3_musl-1.1.16_eabi/node-chakracore-v8.6.0, but the files it is generated is build_dir/target-arm_cortex-a9+vfpv3_musl-1.1.16_eabi/node-chakracore-node-chakracore-v8.6.0.

Do you have an idea what it could be?

include $(TOPDIR)/rules.mk

PKG_NAME:=node-chakracore
PKG_VERSION:=v8.6.0
PKG_RELEASE:=1

PKG_SOURCE_URL:=https://github.com/nodejs/$(PKG_NAME)/archive/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Patrik Laszlo <alabard@gmail.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_INSTALL:=1

HOST_BUILD_DEPENDS:=python/host
PKG_BUILD_DEPENDS:=python/host
PKG_INSTALL:=1
PKG_USE_MIPS16:=0

HOST_BUILD_PARALLEL:=1
PKG_BUILD_PARALLEL:=1

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

define Package/node-chakracore
  SECTION:=lang
  CATEGORY:=Languages
  SUBMENU:=Node.js-Chakra
  TITLE:=Node.js is a platform built on Microsoft Chakra's JavaScript runtime
  URL:=https://github.com/nodejs/node-chakracore
  DEPENDS:=+libstdcpp +libopenssl +zlib +USE_UCLIBC:libpthread +USE_UCLIBC:librt
endef

define Package/node-chakracore/description
  Node.jsĀ® Chakra is a JavaScript runtime built on Chakra's JavaScript engine. Node.js Chakra uses
  an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js Chakra's
   package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
endef

define Package/node-chakracore-npm
  SECTION:=lang
  CATEGORY:=Languages
  SUBMENU:=Node.js-Chakra
  TITLE:=NPM stands for Node Package Manager
  URL:=http://npmjs.com/
  DEPENDS:=+node-chakracore
endef

define Package/node-chakracore-npm/description
 NPM is the package manager for Node.js
endef

NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))

MAKE_VARS+= \
	DESTCPU=$(NODEJS_CPU)

CONFIGURE_ARGS:= \
	--dest-cpu=$(NODEJS_CPU) \
	--dest-os=linux \
	--without-snapshot \
	--shared-zlib \
	--shared-openssl \
	$(if $(findstring mips,$(NODEJS_CPU)), \
		$(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,)) \
	$(if $(findstring arm,$(NODEJS_CPU)), \
		$(if $(CONFIG_SOFT_FLOAT),, \
			$(if $(findstring neon,$(CONFIG_CPU_TYPE)), --with-arm-fpu=neon, \
			$(if $(findstring vfpv3,$(CONFIG_CPU_TYPE)), --with-arm-fpu=vfpv3,)))) \
	--prefix=/usr

HOST_CONFIGURE_VARS:=
HOST_CONFIGURE_ARGS:= \
	--dest-os=linux \
	--without-snapshot \
	--shared-zlib \
	--with-intl=none \
	--prefix=$(STAGING_DIR_HOSTPKG)

HOST_CONFIGURE_CMD:=python ./configure

define Build/Prepare
	$(if $(findstring arm,$(NODEJS_CPU)), $(if $(CONFIG_SOFT_FLOAT), \
		echo "You can't running Node.js on ARM CPU without hardware FPU."; \
		exit 1; \
	))
	$(Build/Prepare/Default)
endef

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include
	$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
endef

define Package/node-chakracore/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
endef

define Package/node-chakracore-npm/install
	$(INSTALL_DIR) $(1)/usr/lib/node_modules
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node_modules/
	$(INSTALL_DIR) $(1)/usr/bin
	$(LN) ../lib/node_modules/npm/bin/npm-cli.js $(1)/usr/bin/npm
endef

$(eval $(call HostBuild))
$(eval $(call BuildPackage,node-chakracore))
$(eval $(call BuildPackage,node-chakracore-npm))

that's weird... PKG_BUILD_DIR was defined as:

PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))

how about adding

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

after including package.mk?

ciao! how are you? never mind, it is an issue with node-chakracore, i will not be expermintal with it, it is still young to use in a router... :slight_smile: