blob: 0ecae5bd6427a9c5ee6e24bbe7c04cbb2b77706c [file] [log] [blame]
wdenkb6a64602002-08-27 17:36:41 +00001#
Marian Balakowiczf9328632006-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 Denk1a459662013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
wdenkb6a64602002-08-27 17:36:41 +00006#
7
Wolfgang Denk19cf2ec2008-04-26 01:25:39 +02008include $(TOPDIR)/config.mk
Kumar Gala03c6cd32008-04-26 11:44:44 -05009include $(OBJTREE)/include/autoconf.mk
wdenkb6a64602002-08-27 17:36:41 +000010
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010011LIB = libpost.o
12GPLIB-$(CONFIG_HAS_POST) += libgenpost.o
Michael Zaidman800eb092010-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 Carlier6d8962e2010-11-05 15:48:07 +010016SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.o
Yuri Tikhonov2d2b9942008-03-31 10:51:37 +020017SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010018 "lib_$(ARCH)/libpost$(ARCH).o"; fi)
Wolfgang Denk6751b052012-03-12 15:00:23 +010019SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH)/fpu ]; then echo \
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010020 "lib_$(ARCH)/fpu/libpost$(ARCH)fpu.o"; fi)
Yuri Tikhonov2d2b9942008-03-31 10:51:37 +020021SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d cpu/$(CPU) ]; then echo \
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010022 "cpu/$(CPU)/libpost$(CPU).o"; fi)
Yuri Tikhonov2d2b9942008-03-31 10:51:37 +020023SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d board/$(BOARD) ]; then echo \
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010024 "board/$(BOARD)/libpost$(BOARD).o"; fi)
wdenkb6a64602002-08-27 17:36:41 +000025
Kumar Gala03c6cd32008-04-26 11:44:44 -050026GPLIB := $(addprefix $(obj),$(GPLIB-y))
27SPLIB := $(addprefix $(obj),$(SPLIB-y))
Yuri Tikhonov2d2b9942008-03-31 10:51:37 +020028COBJS := $(COBJS-y)
29SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
30OBJS := $(addprefix $(obj),$(COBJS))
31LIB := $(obj)$(LIB)
wdenkb6a64602002-08-27 17:36:41 +000032
Wolfgang Denkaa1bcca2008-12-16 14:44:06 +010033all: $(LIB)
Yuri Tikhonov45845302008-12-07 22:12:50 +010034
35postdeps:
36 @for lib in $(SPLIB-y) ; do \
37 $(MAKE) -C `dirname $$lib` all ; \
38 done
Yuri Tikhonov2d2b9942008-03-31 10:51:37 +020039
40# generic POST library
41$(GPLIB): $(obj).depend $(OBJS)
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010042 $(call cmd_link_o_target, $(OBJS))
Yuri Tikhonov2d2b9942008-03-31 10:51:37 +020043
44# specific POST libraries
Wolfgang Denkaa1bcca2008-12-16 14:44:06 +010045$(SPLIB): $(obj).depend postdeps
Yuri Tikhonov2d2b9942008-03-31 10:51:37 +020046 $(MAKE) -C $(dir $(subst $(obj),,$@))
47
48# the POST lib archive
49$(LIB): $(GPLIB) $(SPLIB)
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010050 $(call cmd_link_o_target, $^)
Yuri Tikhonov2d2b9942008-03-31 10:51:37 +020051
52#########################################################################
53
54# defines $(obj).depend target
55include $(SRCTREE)/rules.mk
56
57sinclude $(obj).depend
58
59#########################################################################