wdenk | b6a6460 | 2002-08-27 17:36:41 +0000 | [diff] [blame] | 1 | # |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 2 | # (C) Copyright 2002-2006 |
wdenk | b6a6460 | 2002-08-27 17:36:41 +0000 | [diff] [blame] | 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | # |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 5 | # SPDX-License-Identifier: GPL-2.0+ |
wdenk | b6a6460 | 2002-08-27 17:36:41 +0000 | [diff] [blame] | 6 | # |
| 7 | |
Wolfgang Denk | de946a2 | 2008-04-26 01:25:39 +0200 | [diff] [blame] | 8 | include $(TOPDIR)/config.mk |
Kumar Gala | af8a723 | 2008-04-26 11:44:44 -0500 | [diff] [blame] | 9 | include $(OBJTREE)/include/autoconf.mk |
wdenk | b6a6460 | 2002-08-27 17:36:41 +0000 | [diff] [blame] | 10 | |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 11 | LIB = libpost.o |
| 12 | GPLIB-$(CONFIG_HAS_POST) += libgenpost.o |
Michael Zaidman | f969a68 | 2010-09-20 08:51:53 +0200 | [diff] [blame] | 13 | COBJS-$(CONFIG_HAS_POST) += post.o |
| 14 | COBJS-$(CONFIG_POST_STD_LIST) += tests.o |
wdenk | b6a6460 | 2002-08-27 17:36:41 +0000 | [diff] [blame] | 15 | |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 16 | SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.o |
Yuri Tikhonov | bdfd302 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 17 | SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \ |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 18 | "lib_$(ARCH)/libpost$(ARCH).o"; fi) |
Wolfgang Denk | a1facc9 | 2012-03-12 15:00:23 +0100 | [diff] [blame] | 19 | SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH)/fpu ]; then echo \ |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 20 | "lib_$(ARCH)/fpu/libpost$(ARCH)fpu.o"; fi) |
Yuri Tikhonov | bdfd302 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 21 | SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d cpu/$(CPU) ]; then echo \ |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 22 | "cpu/$(CPU)/libpost$(CPU).o"; fi) |
Yuri Tikhonov | bdfd302 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 23 | SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d board/$(BOARD) ]; then echo \ |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 24 | "board/$(BOARD)/libpost$(BOARD).o"; fi) |
wdenk | b6a6460 | 2002-08-27 17:36:41 +0000 | [diff] [blame] | 25 | |
Kumar Gala | af8a723 | 2008-04-26 11:44:44 -0500 | [diff] [blame] | 26 | GPLIB := $(addprefix $(obj),$(GPLIB-y)) |
| 27 | SPLIB := $(addprefix $(obj),$(SPLIB-y)) |
Yuri Tikhonov | bdfd302 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 28 | COBJS := $(COBJS-y) |
| 29 | SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) |
| 30 | OBJS := $(addprefix $(obj),$(COBJS)) |
| 31 | LIB := $(obj)$(LIB) |
| 32 | |
Wolfgang Denk | abe9082 | 2008-12-16 14:44:06 +0100 | [diff] [blame] | 33 | all: $(LIB) |
Yuri Tikhonov | e68a78a | 2008-12-07 22:12:50 +0100 | [diff] [blame] | 34 | |
| 35 | postdeps: |
| 36 | @for lib in $(SPLIB-y) ; do \ |
| 37 | $(MAKE) -C `dirname $$lib` all ; \ |
| 38 | done |
Yuri Tikhonov | bdfd302 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 39 | |
| 40 | # generic POST library |
| 41 | $(GPLIB): $(obj).depend $(OBJS) |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 42 | $(call cmd_link_o_target, $(OBJS)) |
Yuri Tikhonov | bdfd302 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 43 | |
| 44 | # specific POST libraries |
Wolfgang Denk | abe9082 | 2008-12-16 14:44:06 +0100 | [diff] [blame] | 45 | $(SPLIB): $(obj).depend postdeps |
Yuri Tikhonov | bdfd302 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 46 | $(MAKE) -C $(dir $(subst $(obj),,$@)) |
| 47 | |
| 48 | # the POST lib archive |
| 49 | $(LIB): $(GPLIB) $(SPLIB) |
Sebastien Carlier | a8d426f | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 50 | $(call cmd_link_o_target, $^) |
Yuri Tikhonov | bdfd302 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 51 | |
| 52 | ######################################################################### |
| 53 | |
| 54 | # defines $(obj).depend target |
| 55 | include $(SRCTREE)/rules.mk |
| 56 | |
| 57 | sinclude $(obj).depend |
wdenk | b6a6460 | 2002-08-27 17:36:41 +0000 | [diff] [blame] | 58 | |
Yuri Tikhonov | bdfd302 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 59 | ######################################################################### |