Marek Vasut | c140e98 | 2011-11-08 23:18:08 +0000 | [diff] [blame] | 1 | # |
| 2 | # (C) Copyright 2000-2006 |
| 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+ |
Marek Vasut | c140e98 | 2011-11-08 23:18:08 +0000 | [diff] [blame] | 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/config.mk |
| 9 | |
| 10 | LIB = $(obj)lib$(SOC).o |
| 11 | |
Otavio Salvador | d0cdd92 | 2012-08-05 09:05:34 +0000 | [diff] [blame] | 12 | COBJS = clock.o mxs.o iomux.o timer.o |
Marek Vasut | c140e98 | 2011-11-08 23:18:08 +0000 | [diff] [blame] | 13 | |
Marek Vasut | 151f49d | 2011-12-02 03:47:40 +0000 | [diff] [blame] | 14 | ifdef CONFIG_SPL_BUILD |
Marek Vasut | 80e99eb | 2012-05-01 11:09:49 +0000 | [diff] [blame] | 15 | COBJS += spl_boot.o spl_lradc_init.o spl_mem_init.o spl_power_init.o |
Marek Vasut | 151f49d | 2011-12-02 03:47:40 +0000 | [diff] [blame] | 16 | endif |
| 17 | |
Marek Vasut | c140e98 | 2011-11-08 23:18:08 +0000 | [diff] [blame] | 18 | SRCS := $(START:.o=.S) $(COBJS:.o=.c) |
| 19 | OBJS := $(addprefix $(obj),$(COBJS)) |
| 20 | START := $(addprefix $(obj),$(START)) |
| 21 | |
| 22 | all: $(obj).depend $(LIB) |
| 23 | |
| 24 | $(LIB): $(OBJS) |
| 25 | $(call cmd_link_o_target, $(OBJS)) |
| 26 | |
Marek Vasut | e07153e | 2013-04-28 14:18:49 +0000 | [diff] [blame] | 27 | # Specify the target for use in elftosb call |
| 28 | ELFTOSB_TARGET-$(CONFIG_MX23) = imx23 |
| 29 | ELFTOSB_TARGET-$(CONFIG_MX28) = imx28 |
| 30 | |
| 31 | $(OBJTREE)/u-boot.bd: $(SRCTREE)/$(CPUDIR)/$(SOC)/u-boot-$(ELFTOSB_TARGET-y).bd |
| 32 | sed "s@OBJTREE@$(OBJTREE)@g" $^ > $@ |
| 33 | |
| 34 | $(OBJTREE)/u-boot.sb: $(OBJTREE)/u-boot.bin $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/u-boot.bd |
| 35 | elftosb -zf $(ELFTOSB_TARGET-y) -c $(OBJTREE)/u-boot.bd -o $(OBJTREE)/u-boot.sb |
| 36 | |
Marek Vasut | c140e98 | 2011-11-08 23:18:08 +0000 | [diff] [blame] | 37 | ######################################################################### |
| 38 | |
| 39 | # defines $(obj).depend target |
| 40 | include $(SRCTREE)/rules.mk |
| 41 | |
| 42 | sinclude $(obj).depend |
| 43 | |
| 44 | ######################################################################### |