[color=rgb(184, 92, 0) !important]##############################################
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# OpenWrt Makefile for helloworld program
[color=rgb(184, 92, 0) !important]#
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]#
[color=rgb(184, 92, 0) !important]# Most of the variables used here are defined in
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# the include directives below. We just need to
[color=rgb(184, 92, 0) !important]# specify a basic description of the package,
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# where to build our program, where to find
[color=rgb(184, 92, 0) !important]# the source files, and where to install the
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# compiled program on the router.
[color=rgb(184, 92, 0) !important]#
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# Be very careful of spacing in this file.
[color=rgb(184, 92, 0) !important]# Indents should be tabs, not spaces, and
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# there should be no trailing whitespace in
[color=rgb(184, 92, 0) !important]# lines that are not commented.
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]#
[color=rgb(184, 92, 0) !important]##############################################
[color=rgb(184, 92, 0) !important]# Specify what needs to be done to prepare for building the package.
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# In our case, we need to copy the source files to the build directory.
[color=rgb(184, 92, 0) !important]# This is NOT the default. The default uses the PKG_SOURCE_URL and the
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# PKG_SOURCE which is not defined here to download the source from the web.
[color=rgb(184, 92, 0) !important]# In order to just build a simple program that we have just written, it is
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# much easier to do it this way.
[color=rgb(0, 78, 208) !important]define [color=rgb(0, 45, 122) !important]Build[color=rgb(0, 111, 224) !important]/[color=rgb(0, 78, 208) !important]Prepare
[backcolor=rgb(247, 247, 247) !important][color=rgb(0, 78, 208) !important] [color=rgb(0, 45, 122) !important]mkdir[color=rgb(0, 111, 224) !important] [color=rgb(0, 111, 224) !important]-p[color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important]([color=rgb(0, 45, 122) !important]PKG_BUILD_DIR[color=rgb(51, 51, 51) !important])
[color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important]([color=rgb(0, 45, 122) !important]CP[color=rgb(51, 51, 51) !important])[color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important].[color=rgb(0, 111, 224) !important]/[color=rgb(0, 45, 122) !important]src[color=rgb(0, 111, 224) !important]/[color=rgb(0, 111, 224) !important]*[color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important]([color=rgb(0, 45, 122) !important]PKG_BUILD_DIR[color=rgb(51, 51, 51) !important])[color=rgb(0, 111, 224) !important]/
[backcolor=rgb(247, 247, 247) !important][color=rgb(0, 45, 122) !important]endef
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# We do not need to define Build/Configure or Build/Compile directives
[color=rgb(184, 92, 0) !important]# The defaults are appropriate for compiling a simple program such as this one
[color=rgb(184, 92, 0) !important]# Specify where and how to install the program. Since we only have one file,
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# the helloworld executable, install it by copying it to the /bin directory on
[color=rgb(184, 92, 0) !important]# the router. The $(1) variable represents the root directory on the router running
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install
[color=rgb(184, 92, 0) !important]# directory if it does not already exist. Likewise $(INSTALL_BIN) contains the
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# command to copy the binary file from its current location (in our case the build
[color=rgb(184, 92, 0) !important]# directory) to the install directory.
[backcolor=rgb(247, 247, 247) !important][color=rgb(0, 78, 208) !important]define [color=rgb(128, 0, 128) !important]Package[color=rgb(0, 111, 224) !important]/[color=rgb(0, 45, 122) !important]helloworld[color=rgb(0, 111, 224) !important]/install
[color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important]([color=rgb(0, 45, 122) !important]INSTALL_DIR[color=rgb(51, 51, 51) !important])[color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important]([color=rgb(206, 0, 0) !important]1[color=rgb(51, 51, 51) !important])[color=rgb(0, 111, 224) !important]/bin
[backcolor=rgb(247, 247, 247) !important][color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important]([color=rgb(0, 45, 122) !important]INSTALL_BIN[color=rgb(51, 51, 51) !important])[color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important]([color=rgb(0, 45, 122) !important]PKG_BUILD_DIR[color=rgb(51, 51, 51) !important])[color=rgb(0, 111, 224) !important]/helloworld[color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important]([color=rgb(206, 0, 0) !important]1[color=rgb(51, 51, 51) !important])[color=rgb(0, 111, 224) !important]/[color=rgb(0, 45, 122) !important]bin[color=rgb(0, 111, 224) !important]/
[color=rgb(0, 45, 122) !important]endef
[color=rgb(184, 92, 0) !important]# This line executes the necessary commands to compile our program.
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# The above define directives specify all the information needed, but this
[color=rgb(184, 92, 0) !important]# line calls BuildPackage which in turn actually uses this information to
[backcolor=rgb(247, 247, 247) !important][color=rgb(184, 92, 0) !important]# build a package.
[color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important](eval[color=rgb(0, 111, 224) !important] [color=rgb(51, 51, 51) !important]$[color=rgb(51, 51, 51) !important]([color=rgb(0, 78, 208) !important]call [color=rgb(0, 45, 122) !important]BuildPackage[color=rgb(51, 51, 51) !important],[color=rgb(0, 45, 122) !important]helloworld[color=rgb(51, 51, 51) !important])[color=rgb(51, 51, 51) !important])