Patchwork MARS: fix makefile kernel lib build order

login
register
mail settings
Submitter Yuji Mano
Date Sept. 10, 2008, 6:38 p.m.
Message ID <48C8142F.9080105@am.sony.com>
Download mbox | patch
Permalink /patch/230/
State New
Delegated to: Yuji Mano
Headers show

Comments

Yuji Mano - Sept. 10, 2008, 6:38 p.m.
This fixes a bug in the Makefile that would build the kernel before the lib
which the kernel is dependent on.

This also makes sure the kernel links the lib in the build source and not just
any libmars.a it finds in the library search path.

Signed-off-by: Yuji Mano <yuji.mano@am.sony.com>
Kazunori Asayama - Sept. 11, 2008, 2:04 a.m.
Yuji Mano wrote:
> This fixes a bug in the Makefile that would build the kernel before the lib
> which the kernel is dependent on.
> 
> This also makes sure the kernel links the lib in the build source and not just
> any libmars.a it finds in the library search path.
> 
> Signed-off-by: Yuji Mano <yuji.mano@am.sony.com>

Acked-by: Kazunori Asayama <asayama@sm.sony.co.jp>

> 
> ---
> v2:
>  - change $(srcdir) to $(builddir)
> 
>  src/mpu/Makefile.am        |    2 +-
>  src/mpu/kernel/Makefile.am |    3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
>

Patch

--- a/src/mpu/Makefile.am
+++ b/src/mpu/Makefile.am
@@ -36,7 +36,7 @@ 
 #  LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY.
 #
 
-SUBDIRS = kernel lib
+SUBDIRS = lib kernel
 
 EXTRA_DIST = \
 	bootstrap \
--- a/src/mpu/kernel/Makefile.am
+++ b/src/mpu/kernel/Makefile.am
@@ -54,13 +54,12 @@  mars_kernel_CFLAGS = \
 	-Wmissing-declarations
 
 mars_kernel_LDFLAGS = \
-	-L../lib \
 	-Wl,--defsym=__stack=0x0fff0 \
 	-Wl,-gc-sections \
 	-Wl,-N \
 	-Wl,-s
 
-mars_kernel_LDADD = -lmars
+mars_kernel_LDADD = $(builddir)/../lib/libmars.a
 
 mars_kernel_SOURCES = \
 	mars_kernel.c \