OpenWrt Forum Archive

Topic: Makefile

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I'm trying to understand how does Makefiles work in OpenWRT.
For example how commands like:

  make package/madwifi/compile

does work?
I mean - how make knows what to do in "package/madwifi/compile" .

Any explanation?

I made that change and still be the same problem. it don't apear in the menu config and
this is what I get when I excute the cross-compiling toolchaine:

$ make package/fr-recognizer/compile
+ mkdir -p /home/amir/Bureau/openwrt/staging_dir/toolchain-mipsel_r2_gcc-linaro_uClibc-0.9.32
+ cd /home/amir/Bureau/openwrt/staging_dir/toolchain-mipsel_r2_gcc-linaro_uClibc-0.9.32
+ mkdir -p stamp lib usr/include usr/lib
make[4]: Entering directory `/home/amir/Bureau/openwrt/target/linux'
make[5]: Entering directory `/home/amir/Bureau/openwrt/target/linux/ramips'
make[6]: Entering directory `/home/amir/Bureau/openwrt/target/linux/ramips/image'
make[6]: Leaving directory `/home/amir/Bureau/openwrt/target/linux/ramips/image'
make[5]: Leaving directory `/home/amir/Bureau/openwrt/target/linux/ramips'
make[4]: Leaving directory `/home/amir/Bureau/openwrt/target/linux'
make[1] package/fr-recognizer/compile
make -r package/fr-recognizer/compile: build failed. Please re-run make with V=99 to see what's going on
make: *** [package/fr-recognizer/compile] Error 1


#-------------------------------------------OpenWRT makefile
include $(TOPDIR)/rules.mk

PKG_NAME:=fr-recognizer
PKG_RELEASE:=1

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

include $(INCLUDE_DIR)/package.mk

define Package/fr-recognizer
    SECTION:=utils
    CATEGORY:=Utilities
    TITLE:=fr-recognizer -- excute spoken utterances
endef

define Package/fr-recognizer/description
    DESCRIPTION:=\
    Users may spok commands,\\\
    program identify the spokken words,\\\
    program search the corespendent command and excute it.
endef

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

define Package/fr-recognizer/install
    $(INSTALL_DIR) $(1)/bin
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/fr-recognizer $(1)/bin/
endef

$(eval $(call BuildPackage,fr-recognizer))

The discussion might have continued from here.