Statistics
| Branch: | Revision:

root / custompackages / hello-boost-graph / Makefile @ 146281ca

History | View | Annotate | Download (2.89 KB)

1
##############################################
2
# OpenWrt Makefile for hello-boost-graph program
3
#
4
#
5
# Most of the variables used here are defined in
6
# the include directives below. We just need to
7
# specify a basic description of the package,
8
# where to build our program, where to find
9
# the source files, and where to install the
10
# compiled program on the router.
11
#
12
# Be very careful of spacing in this file.
13
# Indents should be tabs, not spaces, and
14
# there should be no trailing whitespace in
15
# lines that are not commented.
16
#
17
##############################################
18

    
19
include $(TOPDIR)/rules.mk
20

    
21
# Name and release number of this package
22
PKG_NAME:=hello-boost-graph
23
PKG_RELEASE:=1
24

    
25
# This specifies the directory where we're going to build the program.
26
# The root build directory, $(BUILD_DIR), is by default the build_mipsel
27
# directory in your OpenWrt SDK directory
28
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
29

    
30

    
31
include $(INCLUDE_DIR)/package.mk
32

    
33

    
34
# Specify package information for this program.
35
# The variables defined here should be self explanatory.
36
define Package/hello-boost-graph
37
	SECTION:=utils
38
	CATEGORY:=Utilities
39
	TITLE:=Hello World for Boost Graph Library (BGL)
40
	MAINTAINER:=Quynh Nguyen <quynh.xq@gmail.com>
41
	DEPENDS:=+libstdcpp +boost +boost-graph
42
endef
43

    
44
define Package/hello-boost-graph/description
45
	A simple program to test Boost Graph Library
46
endef
47

    
48
# Specify what needs to be done to prepare for building the package.
49
# In our case, we need to copy the source files to the build directory.
50
# This is NOT the default.  The default uses the PKG_SOURCE_URL and the
51
# PKG_SOURCE which is not defined here to download the source from the web.
52
# In order to just build a simple program that we have just written, it is
53
# much easier to do it this way.
54
define Build/Prepare
55
	mkdir -p $(PKG_BUILD_DIR)
56
	$(CP) ./src/* $(PKG_BUILD_DIR)/
57
endef
58

    
59

    
60
# We do not need to define Build/Configure or Build/Compile directives
61
# The defaults are appropriate for compiling a simple program such as this one
62

    
63

    
64
# Specify where and how to install the program. Since we only have one file,
65
# the hello-boost-graph executable, install it by copying it to the /bin directory on
66
# the router. The $(1) variable represents the root directory on the router running
67
# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install
68
# directory if it does not already exist.  Likewise $(INSTALL_BIN) contains the
69
# command to copy the binary file from its current location (in our case the build
70
# directory) to the install directory.
71
define Package/hello-boost-graph/install
72
	$(INSTALL_DIR) $(1)/bin
73
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/hello-boost-graph $(1)/bin/
74
endef
75

    
76

    
77
# This line executes the necessary commands to compile our program.
78
# The above define directives specify all the information needed, but this
79
# line calls BuildPackage which in turn actually uses this information to
80
# build a package.
81
$(eval $(call BuildPackage,hello-boost-graph))