From d06645d8eddce3a22144a9ef8961a8f7599d319e Mon Sep 17 00:00:00 2001
From: Eric Andersen Each directory contains at least 3 files : Each directory contains at least 2 files : The main Makefile do the job through the following steps (once the
@@ -343,9 +339,10 @@
Of course, you can add other options to configure particular
things in your software. Then, write a As you can see, this short Makefile simply adds the
- target Finally, here's the hardest part. Create a file named
@@ -520,6 +497,15 @@ endif
48 foo-dirclean:
49 rm -rf $(FOO_DIR)
50
+ 51 #############################################################
+ 52 #
+ 53 # Toplevel Makefile options
+ 54 #
+ 55 #############################################################
+ 56 ifeq ($(strip $(BR2_PACKAGE_FOO)),y)
+ 57 TARGETS+=foo
+ 58 endif
+
First of all, this Makefile example works for a single
@@ -602,11 +588,13 @@ endif
removed to save space. Line 40 defines the main target of the software, the one
- referenced in the
something.mk
is the Makefile that downloads, configures,
@@ -302,10 +302,6 @@
description file. It describes the option related to the current
software.Makefile.in
is a part of Makefile that sets various
- variables according to the configuration given through the configuration
- tool. For most tools it simply involves adding the name of the tool to
- the TARGETS
variable.target/default/target_skeleton
and then removes useless
CVS/
directories.
- TARGETS
dependency. This is where all the job
- is done : all Makefile.in
files "subscribe" targets into
- this global variable, so that the needed tools gets compiled.TARGETS
dependency. This should generally check
+ if the configuration option for this package is enabled, and if so then
+ "subscribe" this package to be compiled by adding it to the TARGETS
+ global variable.Using the
@@ -441,26 +438,6 @@ config BR2_PACKAGE_FOO
-
- Makefile.in
fileMakefile.in
file. Basically, this is
- a very short Makefile that adds the name of the software to
- the list of TARGETS
that Buildroot will generate. In
- fact, the name of the software is the the identifier of the target
- inside the real Makefile that will do everything (download,
- compile, install), and that we study below. Back to
- Makefile.in
, here is an example :
-ifeq ($(strip $(BR2_PACKAGE_FOO)),y)
-TARGETS+=foo
-endif
-
-
- foo
to the list of targets handled by Buildroot
- if software foo was selected using the configuration tool.The real Makefile
Makefile.in
file. This targets
- should first of all depends on the dependecies of the software (in
- our example, uclibc and ncurses), and then to the
+ that will be eventually be used by the top level
+ Makefile
to download, compile, and then install
+ this package. This target should first of all depends on all
+ needed dependecies of the software (in our example,
+ uclibc and ncurses), and also depend on the
final binary. This last dependency will call all previous
- dependencies in the right order.
Line 42 defines a simple target that only downloads the code source. This is not used during normal operation of Buildroot, but @@ -619,6 +607,17 @@ endif directory in which the software was uncompressed, configured and compiled.
+Lines 51-58 adds the target foo
to the list
+ of targets to be compiled by Buildroot by first checking if
+ the configuration option for this package has been enabled
+ using the configuration tool, and if so then "subscribes"
+ this package to be compiled by adding it to the TARGETS
+ global variable. The name added to the TARGETS global
+ variable is the name of this package's target, as defined on
+ line 40, which is used by Buildroot to download, compile, and
+ then install this package.
As you can see, adding a software to buildroot is simply a -- cgit v1.2.3