wdenk | b6a6460 | 2002-08-27 17:36:41 +0000 | [diff] [blame] | 1 | # |
Marian Balakowicz | f932863 | 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 | 1a45966 | 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 | 19cf2ec | 2008-04-26 01:25:39 +0200 | [diff] [blame] | 8 | include $(TOPDIR)/config.mk |
Kumar Gala | 03c6cd3 | 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 | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 11 | LIB = libpost.o |
| 12 | GPLIB-$(CONFIG_HAS_POST) += libgenpost.o |
Michael Zaidman | 800eb09 | 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 | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 16 | SPLIB-$(CONFIG_HAS_POST) = drivers/libpostdrivers.o |
Yuri Tikhonov | 2d2b994 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 17 | SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH) ]; then echo \ |
Sebastien Carlier | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 18 | "lib_$(ARCH)/libpost$(ARCH).o"; fi) |
Wolfgang Denk | 6751b05 | 2012-03-12 15:00:23 +0100 | [diff] [blame] | 19 | SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d lib_$(ARCH)/fpu ]; then echo \ |
Sebastien Carlier | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 20 | "lib_$(ARCH)/fpu/libpost$(ARCH)fpu.o"; fi) |
Yuri Tikhonov | 2d2b994 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 21 | SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d cpu/$(CPU) ]; then echo \ |
Sebastien Carlier | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 22 | "cpu/$(CPU)/libpost$(CPU).o"; fi) |
Yuri Tikhonov | 2d2b994 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 23 | SPLIB-$(CONFIG_HAS_POST) += $(shell if [ -d board/$(BOARD) ]; then echo \ |
Sebastien Carlier | 6d8962e | 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 | 03c6cd3 | 2008-04-26 11:44:44 -0500 | [diff] [blame] | 26 | GPLIB := $(addprefix $(obj),$(GPLIB-y)) |
| 27 | SPLIB := $(addprefix $(obj),$(SPLIB-y)) |
Yuri Tikhonov | 2d2b994 | 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) |
wdenk | b6a6460 | 2002-08-27 17:36:41 +0000 | [diff] [blame] | 32 | |
Wolfgang Denk | aa1bcca | 2008-12-16 14:44:06 +0100 | [diff] [blame] | 33 | all: $(LIB) |
Yuri Tikhonov | 4584530 | 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 | 2d2b994 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 39 | |
| 40 | # generic POST library |
| 41 | $(GPLIB): $(obj).depend $(OBJS) |
Sebastien Carlier | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 42 | $(call cmd_link_o_target, $(OBJS)) |
Yuri Tikhonov | 2d2b994 | 2008-03-31 10:51:37 +0200 | [diff] [blame] | 43 | |
| 44 | # specific POST libraries |
Wolfgang Denk | aa1bcca | 2008-12-16 14:44:06 +0100 | [diff] [blame] | 45 | $(SPLIB): $(obj).depend postdeps |
Yuri Tikhonov | 2d2b994 | 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 | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 50 | $(call cmd_link_o_target, $^) |
Yuri Tikhonov | 2d2b994 | 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 |
| 58 | |
| 59 | ######################################################################### |