blob: 0ecae5bd6427a9c5ee6e24bbe7c04cbb2b77706c [file] [log] [blame]
wdenkb6a64602002-08-27 17:36:41 +00001#
Marian Balakowiczd62379d2006-09-01 19:49:50 +02002# (C) Copyright 2002-2006
wdenkb6a64602002-08-27 17:36:41 +00003# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
wdenkb6a64602002-08-27 17:36:41 +00006#
7
Wolfgang Denkde946a22008-04-26 01:25:39 +02008include $(TOPDIR)/config.mk
Kumar Galaaf8a7232008-04-26 11:44:44 -05009include $(OBJTREE)/include/autoconf.mk
wdenkb6a64602002-08-27 17:36:41 +000010
Sebastien Carliera8d426f2010-11-05 15:48:07 +010011LIB = libpost.o
12GPLIB-$(CONFIG_HAS_POST) += libgenpost.o
Michael Zaidmanf969a682010-09-20 08:51:53 +020013COBJS-$(CONFIG_HAS_POST) += post.o
14COBJS-$(CONFIG_POST_STD_LIST) += tests.o
wdenkb6a64602002-08-27 17:36:41 +000015
Sebastien Carliera8d426f2010-11-05 15:48:07 +010016SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.o
Yuri Tikhonovbdfd3022008-03-31 10:51:37 +020017SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \
Sebastien Carliera8d426f2010-11-05 15:48:07 +010018 "lib_$(ARCH)/libpost$(ARCH).o"; fi)
Wolfgang Denka1facc92012-03-12 15:00:23 +010019SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH)/fpu ]; then echo \
Sebastien Carliera8d426f2010-11-05 15:48:07 +010020 "lib_$(ARCH)/fpu/libpost$(ARCH)fpu.o"; fi)
Yuri Tikhonovbdfd3022008-03-31 10:51:37 +020021SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d cpu/$(CPU) ]; then echo \
Sebastien Carliera8d426f2010-11-05 15:48:07 +010022 "cpu/$(CPU)/libpost$(CPU).o"; fi)
Yuri Tikhonovbdfd3022008-03-31 10:51:37 +020023SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d board/$(BOARD) ]; then echo \
Sebastien Carliera8d426f2010-11-05 15:48:07 +010024 "board/$(BOARD)/libpost$(BOARD).o"; fi)
wdenkb6a64602002-08-27 17:36:41 +000025
Kumar Galaaf8a7232008-04-26 11:44:44 -050026GPLIB := $(addprefix $(obj),$(GPLIB-y))
27SPLIB := $(addprefix $(obj),$(SPLIB-y))
Yuri Tikhonovbdfd3022008-03-31 10:51:37 +020028COBJS := $(COBJS-y)
29SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
30OBJS := $(addprefix $(obj),$(COBJS))
31LIB := $(obj)$(LIB)
32
Wolfgang Denkabe90822008-12-16 14:44:06 +010033all: $(LIB)
Yuri Tikhonove68a78a2008-12-07 22:12:50 +010034
35postdeps:
36 @for lib in $(SPLIB-y) ; do \
37 $(MAKE) -C `dirname $$lib` all ; \
38 done
Yuri Tikhonovbdfd3022008-03-31 10:51:37 +020039
40# generic POST library
41$(GPLIB): $(obj).depend $(OBJS)
Sebastien Carliera8d426f2010-11-05 15:48:07 +010042 $(call cmd_link_o_target, $(OBJS))
Yuri Tikhonovbdfd3022008-03-31 10:51:37 +020043
44# specific POST libraries
Wolfgang Denkabe90822008-12-16 14:44:06 +010045$(SPLIB): $(obj).depend postdeps
Yuri Tikhonovbdfd3022008-03-31 10:51:37 +020046 $(MAKE) -C $(dir $(subst $(obj),,$@))
47
48# the POST lib archive
49$(LIB): $(GPLIB) $(SPLIB)
Sebastien Carliera8d426f2010-11-05 15:48:07 +010050 $(call cmd_link_o_target, $^)
Yuri Tikhonovbdfd3022008-03-31 10:51:37 +020051
52#########################################################################
53
54# defines $(obj).depend target
55include $(SRCTREE)/rules.mk
56
57sinclude $(obj).depend
wdenkb6a64602002-08-27 17:36:41 +000058
Yuri Tikhonovbdfd3022008-03-31 10:51:37 +020059#########################################################################