openwrt helloworld

include $(TOPDIR)/rules.mk



PKG_NAME:=helloworld

PKG_VERSION:=1.0

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

include $(INCLUDE_DIR)/package.mk

define Package/helloworld

  CATEGORY:=Helloworld

  TITLE:=Helloworld -- by hzlarm

endef

define Build/Prepare

        mkdir -p $(PKG_BUILD_DIR)

        $(CP) ./src/* $(PKG_BUILD_DIR)/

endef

define Package/helloworld/install

        $(INSTALL_DIR) $(1)/bin

        $(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/bin/

endef

$(eval $(call BuildPackage,helloworld)) 

  

Add a variable called source_dir with the directory address to your code in your makefile. for example:

SOURCE_DIR:=/home/johndoe/helloworld

also you need to update your package feeds using:

cd /home/johndoe/openwrt
./scripts/feeds update mypackages
./scripts/feeds install -a -p mypackages
【转】https://stackoverflow.com/questions/51511225/no-rule-to-make-target-package-helloworld-install-stop

注意:Makefile格式 最后一行没有tab

posted on 2023-02-15 10:34  lydstory  阅读(23)  评论(0编辑  收藏  举报

导航