]> git.karo-electronics.de Git - karo-tx-uboot.git/blob - post/Makefile
0ecae5bd6427a9c5ee6e24bbe7c04cbb2b77706c
[karo-tx-uboot.git] / post / Makefile
1 #
2 # (C) Copyright 2002-2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 #
5 # SPDX-License-Identifier:      GPL-2.0+
6 #
7
8 include $(TOPDIR)/config.mk
9 include $(OBJTREE)/include/autoconf.mk
10
11 LIB                             = libpost.o
12 GPLIB-$(CONFIG_HAS_POST)        += libgenpost.o
13 COBJS-$(CONFIG_HAS_POST)        += post.o
14 COBJS-$(CONFIG_POST_STD_LIST)   += tests.o
15
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)
25
26 GPLIB   := $(addprefix $(obj),$(GPLIB-y))
27 SPLIB   := $(addprefix $(obj),$(SPLIB-y))
28 COBJS   := $(COBJS-y)
29 SRCS    := $(SOBJS:.o=.S) $(COBJS:.o=.c)
30 OBJS    := $(addprefix $(obj),$(COBJS))
31 LIB     := $(obj)$(LIB)
32
33 all:    $(LIB)
34
35 postdeps:
36         @for lib in $(SPLIB-y) ; do \
37                 $(MAKE) -C `dirname $$lib` all ; \
38         done
39
40 # generic POST library
41 $(GPLIB): $(obj).depend $(OBJS)
42         $(call cmd_link_o_target, $(OBJS))
43
44 # specific POST libraries
45 $(SPLIB): $(obj).depend postdeps
46         $(MAKE) -C $(dir $(subst $(obj),,$@))
47
48 # the POST lib archive
49 $(LIB): $(GPLIB) $(SPLIB)
50         $(call cmd_link_o_target, $^)
51
52 #########################################################################
53
54 # defines $(obj).depend target
55 include $(SRCTREE)/rules.mk
56
57 sinclude $(obj).depend
58
59 #########################################################################