2 # (C) Copyright 2002-2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # SPDX-License-Identifier: GPL-2.0+
8 include $(TOPDIR)/config.mk
11 GPLIB-$(CONFIG_HAS_POST) += libgenpost.o
12 COBJS-$(CONFIG_HAS_POST) += post.o
13 COBJS-$(CONFIG_POST_STD_LIST) += tests.o
15 SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.o
16 SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \
17 "lib_$(ARCH)/libpost$(ARCH).o"; fi)
18 SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH)/fpu ]; then echo \
19 "lib_$(ARCH)/fpu/libpost$(ARCH)fpu.o"; fi)
20 SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d cpu/$(CPU) ]; then echo \
21 "cpu/$(CPU)/libpost$(CPU).o"; fi)
22 SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d board/$(BOARD) ]; then echo \
23 "board/$(BOARD)/libpost$(BOARD).o"; fi)
25 GPLIB := $(addprefix $(obj),$(GPLIB-y))
26 SPLIB := $(addprefix $(obj),$(SPLIB-y))
28 SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
29 OBJS := $(addprefix $(obj),$(COBJS))
35 @for lib in $(SPLIB-y) ; do \
36 $(MAKE) -C `dirname $$lib` all ; \
39 # generic POST library
40 $(GPLIB): $(obj).depend $(OBJS)
41 $(call cmd_link_o_target, $(OBJS))
43 # specific POST libraries
44 $(SPLIB): $(obj).depend postdeps
45 $(MAKE) -C $(dir $(subst $(obj),,$@))
47 # the POST lib archive
48 $(LIB): $(GPLIB) $(SPLIB)
49 $(call cmd_link_o_target, $^)
51 #########################################################################
53 # defines $(obj).depend target
54 include $(SRCTREE)/rules.mk
56 sinclude $(obj).depend
58 #########################################################################