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
9 include $(OBJTREE)/include/autoconf.mk
12 GPLIB-$(CONFIG_HAS_POST) += libgenpost.o
13 COBJS-$(CONFIG_HAS_POST) += post.o
14 COBJS-$(CONFIG_POST_STD_LIST) += tests.o
16 SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.o
17 SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \
18 "lib_$(ARCH)/libpost$(ARCH).o"; fi)
19 SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH)/fpu ]; then echo \
20 "lib_$(ARCH)/fpu/libpost$(ARCH)fpu.o"; fi)
21 SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d cpu/$(CPU) ]; then echo \
22 "cpu/$(CPU)/libpost$(CPU).o"; fi)
23 SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d board/$(BOARD) ]; then echo \
24 "board/$(BOARD)/libpost$(BOARD).o"; fi)
26 GPLIB := $(addprefix $(obj),$(GPLIB-y))
27 SPLIB := $(addprefix $(obj),$(SPLIB-y))
29 SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
30 OBJS := $(addprefix $(obj),$(COBJS))
36 @for lib in $(SPLIB-y) ; do \
37 $(MAKE) -C `dirname $$lib` all ; \
40 # generic POST library
41 $(GPLIB): $(obj).depend $(OBJS)
42 $(call cmd_link_o_target, $(OBJS))
44 # specific POST libraries
45 $(SPLIB): $(obj).depend postdeps
46 $(MAKE) -C $(dir $(subst $(obj),,$@))
48 # the POST lib archive
49 $(LIB): $(GPLIB) $(SPLIB)
50 $(call cmd_link_o_target, $^)
52 #########################################################################
54 # defines $(obj).depend target
55 include $(SRCTREE)/rules.mk
57 sinclude $(obj).depend
59 #########################################################################