malek tio
malek tio

Reputation: 25

the way to put my own package and compile openwrt

I wrote my own openwrt package for my script and the compilation stage I put it in the package file as this path openwrt / feeds / package / is that the path is correct or not? or if I have is for the compilation error:

make[1]: *** No rule to make target `package/test/compile'.  Stop.
make: *** [package/test/compile] Error 2

THis my Makefile:

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=test
PKG_VERSION:=1.0
PKG_RELEASE:=1 
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
DEPENDS:= +nmap +python 



include $(INCLUDE_DIR)/package.mk

define Package/test
SECTION:=secure
CATEGORY:=Monitoring
TITLE:=test

define Package/test/description
test tis is my first package
endef


define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/

endef


define Package/test/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/test $(1)/bin/
endef

$(eval $(call BuildPackage,test))

I need help please. thanks.

Upvotes: 0

Views: 5150

Answers (1)

whyalex
whyalex

Reputation: 81

You don't really have to put your source code anywhere in the /openwrt/ folder. It can be placed, let's say, in /Documents/[name] folder. However it is important that you put your OpenWRT-specific Makefile in the /openwrt/ tree. I am not sure if putting your Makefile in /openwrt/feeds/package is correct but I put my Makefiles in /openwrt/package/[name] folder which works fine. Your source code will be automatically copied by the toolchain to the same folder anyway.

Note: if you place your source code somewhere on your system (for example, in the Documents folder) you have to specify the path to it in your Makefile as follows: PKG_SOURCE_URL:=file://$(TOPDIR)/../Documents/[name]

Your make[1] errors are basically telling you that the toolchain could not find the Makefile. Try putting Makefile in /openwrt/package/[name].

Upvotes: 2

Related Questions