I have been following the guide to create a simple package Hello World by this wonderful link. I want to use GNU Make for compilation and created a Makefile in the feed folder and in the source folder as well. By invoking the commands "make package/hello_world/{clean,compile}" I get the next error:
install -m0755 /home/taras/openwrt/build_dir/target-i386_pentium4_musl/hello-world-1.0/hello-world /home/taras/openwrt/build_dir/target-i386_pentium4_musl/hello-world-1.0/.pkgdir/hello-world/usr/sbin/hello-world
install: cannot stat '/home/taras/openwrt/build_dir/target-i386_pentium4_musl/hello-world-1.0/hello-world': No such file or directory
Here is a snippet of my Makefile below:
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/package.mk
PKG_NAME:=hello-world
PKG_RELEASE:=1
PKG_VERSION:=1.0
# Source settings (i.e. where to find the source codes)
# This is a custom variable, used below
SOURCE_DIR:=/home/taras/hello-world
define Package/hello-world
SECTION:=examples
CATEGORY:=Examples
TITLE:=Simple program to demonstrate creating packages in OpenWRT
endef
define Package/hello-world/description
Outputs the "hello world from OpenWRT" message to the console
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
cp $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
$(Build/Patch)
endef
define Build/Compile
# $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/hello-world.o -c $(PKG_BUILD_DIR)/hello-world.c
# $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/hello-world $(PKG_BUILD_DIR)/hello-world.o
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
endef
define Package/hello-world/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hello-world $(1)/usr/sbin/hello-world
endef
$(eval $(call BuildPackage,hello-world))