Statistics
| Branch: | Revision:

root / custompackages / graph-parser / Makefile @ f9e3a1f0

History | View | Annotate | Download (2.99 KB)

1 af008982 Quynh PX Nguyen
##############################################
2
# OpenWrt Makefile for graph-parser 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:=graph-parser
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/graph-parser
37
	SECTION:=utils
38
	CATEGORY:=Utilities
39
	TITLE:=Graph Parser with Boost Graph Library (BGL)
40
	MAINTAINER:=Quynh Nguyen <quynh.xq@gmail.com>
41
	DEPENDS:=+libstdcpp +boost +boost-graph
42
endef
43
44
define Package/graph-parser/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 f9e3a1f0 Quynh PX Nguyen
	mkdir -p $(PKG_BUILD_DIR)/input
58
	$(CP) ./input/* $(PKG_BUILD_DIR)/input/
59 af008982 Quynh PX Nguyen
endef
60
61
62
# We do not need to define Build/Configure or Build/Compile directives
63
# The defaults are appropriate for compiling a simple program such as this one
64
65
66
# Specify where and how to install the program. Since we only have one file,
67
# the graph-parser executable, install it by copying it to the /bin directory on
68
# the router. The $(1) variable represents the root directory on the router running
69
# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install
70
# directory if it does not already exist.  Likewise $(INSTALL_BIN) contains the
71
# command to copy the binary file from its current location (in our case the build
72
# directory) to the install directory.
73
define Package/graph-parser/install
74
	$(INSTALL_DIR) $(1)/bin
75
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/graph-parser $(1)/bin/
76 f9e3a1f0 Quynh PX Nguyen
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/input/simple.edges $(1)/bin/
77 af008982 Quynh PX Nguyen
endef
78
79
80
# This line executes the necessary commands to compile our program.
81
# The above define directives specify all the information needed, but this
82
# line calls BuildPackage which in turn actually uses this information to
83
# build a package.
84
$(eval $(call BuildPackage,graph-parser))