Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6758409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:47:10+00:00 2026-05-26T13:47:10+00:00

I am following a tutorial for compiling my own package in openwrt. In the

  • 0

I am following a tutorial for compiling my own package in openwrt.

In the /package/helloworld directory:

.../packege/helloworld$ ls
src Makefile
.../packege/helloworld$ ls src
hello.c main.c Makefile
.../packege/helloworld$vi Makefile

#helloworld makefile
include $(TOPDIR)/rules.mk

PKG_NAME:=helloworld
PKG_RELEASE:=1
PKG_VERSION:=0.1

PKG_BUILD_DEPENDS:=

include $(INCLUDE_DIR)/package.mk

define Package/helloworld
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=@TARGET_etrax
  TITLE:=Yet Another Helloworld Application
endef

define Package/helloworld/description
 This is helloworld :p
endef

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

define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
    $(TARGET_CONFIGURE_OPTS) \
    CFLAGS="$(TARGET_CFLAGS)"
endef

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

$(eval $(call BuildPackage,helloworld))

I have two questions about this Makefile:

  1. I found there are commands, such as mkdir, $(CP),$(MAKE). I changed $(CP) to cp, and the compiling goes well. So I don’t understand why these two kinds of formats exsits.

  2. Where the parameters, such as $(PKG_BUILD_DIR), $(INSTALL_DIR), are defined in openwrt? I just found the place where $(TOPDIR) is defined but not the others.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:47:10+00:00Added an answer on May 26, 2026 at 1:47 pm
    1. These are not different kinds of formats, cp is a Linux command, $(CP) is a makefile construction for “getting the value of make variable CP“. Thus, under Linux it should expand to cp (i.e. should be initialized with this value somewhere), and , most probably, to copy under Windows (this is all particular setup-dependent since cp is not fully the same as copy). The same with $(MKDIR) and other system tools.

      1.1. $(MAKE) is actually another thing – this is a special make variable which expands to make tool name with arguments/flags passed from command line. Read this.

    2. These are all variables controlling where to build and where to install. See description here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following the kernel tutorial from here im having problems compiling my files. i
I'm following the tutorial located at: http://www.asp.net/learn/mvc/tutorial-20-cs.aspx I created my own .Menu() method to
I have a compiling problem. I followed tutorial about Hello world program for Android
I am following this tutorial for compiling SQLite with SQLCipher on Windows. I am
I have some problems using OpenSSL. I'm following the tutorial for compiling OpenSSL for
I'm using the following tutorial http://developer.android.com/resources/tutorials/views/hello-mapview.html in order to create a map view and
I am following the following tutorial ( http://www.highoncoding.com/Articles/642_Creating_a_Stock_Widget_in_ASP_NET_MVC_Application.aspx ) on using ajax to render
I am trying to go through the following tutorial on asp.net. When I get
I've been following this tutorial (lesson 6) in order to build and deploy a
I'm following this tutorial (seems good) for Rails. After I run ruby script/generate scaffold

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.