- In the package compiled directory, create a folder hello.
- In hello folder and then create a src folder and Makefile.
Makefile:
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=hello
PKG_VERSION:=1
PKG_RELEASE:=20191015
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=hello
TITLE:=hello world! test .
endef
define Package/$(PKG_NAME)/description
hello world! test .hello world! test .
endef
define Build/Prepare
@echo -e "b"
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
@echo -e "ccccccc"
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
@echo -e "ccccccc"
endef
define Package/$(PKG_NAME)/install
@echo -e "dddddd"
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hello $(1)/bin/
@echo -e "dddddd"
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
- Create a folder and then src Makefile file.
Makefile:
all:
$(CC) $(CFLAGS) hello.c -o hello
clean:
rm *.o hello
- make menuconfig -> hello to the
- make package / hello / compile V = s compiled
- Get IPK package:
- In Openwrt system, using scp link @ Destination: absolute path to a local file path
- In the Ubuntu system, using python -m SimpleHTTPServer 8080, using wget destination address in the Openwrt: 8080 // target file
- In Openwrt system installation package IPK:
- opkg install target IPK package