Chander Kashyap | 7fc795f | 2011-05-24 20:02:57 +0000 | [diff] [blame] | 1 | # |
| 2 | # (C) Copyright 2006-2007 |
| 3 | # Stefan Roese, DENX Software Engineering, sr@denx.de. |
| 4 | # |
| 5 | # (C) Copyright 2008 |
| 6 | # Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de> |
| 7 | # |
| 8 | # (C) Copyright 2011 |
| 9 | # Chander Kashyap, Samsung Electronics, <k.chander@samsung.com> |
| 10 | # |
| 11 | # See file CREDITS for list of people who contributed to this |
| 12 | # project. |
| 13 | # |
| 14 | # This program is free software; you can redistribute it and/or |
| 15 | # modify it under the terms of the GNU General Public License as |
| 16 | # published by the Free Software Foundation; either version 2 of |
| 17 | # the License, or (at your option) any later version. |
| 18 | # |
| 19 | # This program is distributed in the hope that it will be useful, |
| 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | # GNU General Public License for more details. |
| 23 | # |
| 24 | # You should have received a copy of the GNU General Public License |
| 25 | # along with this program; if not, write to the Free Software |
| 26 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 27 | # MA 02111-1307 USA |
| 28 | # |
| 29 | |
| 30 | CONFIG_MMC_SPL = y |
| 31 | |
| 32 | include $(TOPDIR)/config.mk |
| 33 | |
| 34 | LDSCRIPT= $(TOPDIR)/mmc_spl/board/$(BOARDDIR)/u-boot.lds |
| 35 | LDFLAGS = -Bstatic -T $(mmcobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS) |
| 36 | AFLAGS += -DCONFIG_MMC_SPL |
Chander Kashyap | c907652 | 2011-07-27 20:36:30 +0000 | [diff] [blame] | 37 | AFLAGS += -DCONFIG_SPL_BUILD |
Chander Kashyap | 7fc795f | 2011-05-24 20:02:57 +0000 | [diff] [blame] | 38 | CFLAGS += -DCONFIG_MMC_SPL |
Aneesh V | 552a319 | 2011-07-13 05:11:07 +0000 | [diff] [blame] | 39 | CFLAGS += -DCONFIG_SPL_BUILD |
Chander Kashyap | 7fc795f | 2011-05-24 20:02:57 +0000 | [diff] [blame] | 40 | |
| 41 | SOBJS = start.o mem_setup.o lowlevel_init.o |
| 42 | COBJS = mmc_boot.o |
| 43 | |
Chander Kashyap | 80b0af5 | 2011-06-02 18:07:32 +0000 | [diff] [blame] | 44 | SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) |
Chander Kashyap | 7fc795f | 2011-05-24 20:02:57 +0000 | [diff] [blame] | 45 | OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) |
| 46 | __OBJS := $(SOBJS) $(COBJS) |
| 47 | LNDIR := $(OBJTREE)/mmc_spl/board/$(BOARDDIR) |
| 48 | |
| 49 | mmcobj := $(OBJTREE)/mmc_spl/ |
| 50 | |
| 51 | |
| 52 | MKV310_MMC_SPL_EXEC = mkv310_mmc_spl_exec |
| 53 | MMC_SPL_BIN = u-boot-mmc-spl.bin |
| 54 | |
| 55 | ALL = $(mmcobj)u-boot-spl $(mmcobj)u-boot-spl.bin $(mmcobj)$(MMC_SPL_BIN) |
| 56 | |
| 57 | all: $(obj).depend $(ALL) |
| 58 | |
| 59 | $(mmcobj)$(MMC_SPL_BIN): $(mmcobj)u-boot-spl.bin tools/$(MKV310_MMC_SPL_EXEC) |
| 60 | ./tools/$(MKV310_MMC_SPL_EXEC) $(mmcobj)u-boot-spl.bin $(mmcobj)$(MMC_SPL_BIN) |
| 61 | rm -f tools/$(MKV310_MMC_SPL_EXEC) |
| 62 | |
| 63 | tools/$(MKV310_MMC_SPL_EXEC): tools/mkv310_image.c |
| 64 | $(HOSTCC) tools/mkv310_image.c -o tools/$(MKV310_MMC_SPL_EXEC) |
| 65 | |
| 66 | $(mmcobj)u-boot-spl.bin: $(mmcobj)u-boot-spl |
| 67 | $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ |
| 68 | |
| 69 | $(mmcobj)u-boot-spl: $(OBJS) $(mmcobj)u-boot.lds |
| 70 | cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \ |
| 71 | -Map $(mmcobj)u-boot-spl.map \ |
| 72 | -o $(mmcobj)u-boot-spl |
| 73 | |
| 74 | $(mmcobj)u-boot.lds: $(LDSCRIPT) |
| 75 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ |
| 76 | |
| 77 | # create symbolic links for common files |
| 78 | |
| 79 | # from cpu directory |
Chander Kashyap | 80b0af5 | 2011-06-02 18:07:32 +0000 | [diff] [blame] | 80 | start.S: |
Chander Kashyap | 7fc795f | 2011-05-24 20:02:57 +0000 | [diff] [blame] | 81 | @rm -f $@ |
| 82 | @ln -s $(TOPDIR)/arch/arm/cpu/armv7/start.S $@ |
| 83 | |
| 84 | # from board directory |
Chander Kashyap | 80b0af5 | 2011-06-02 18:07:32 +0000 | [diff] [blame] | 85 | mem_setup.S: |
Chander Kashyap | 7fc795f | 2011-05-24 20:02:57 +0000 | [diff] [blame] | 86 | @rm -f $@ |
| 87 | @ln -s $(TOPDIR)/board/samsung/smdkv310/mem_setup.S $@ |
| 88 | |
Chander Kashyap | 80b0af5 | 2011-06-02 18:07:32 +0000 | [diff] [blame] | 89 | lowlevel_init.S: |
Chander Kashyap | 7fc795f | 2011-05-24 20:02:57 +0000 | [diff] [blame] | 90 | @rm -f $@ |
| 91 | @ln -s $(TOPDIR)/board/samsung/smdkv310/lowlevel_init.S $@ |
| 92 | |
| 93 | ######################################################################### |
| 94 | |
Chander Kashyap | 80b0af5 | 2011-06-02 18:07:32 +0000 | [diff] [blame] | 95 | $(obj)%.o: %.S |
Chander Kashyap | 7fc795f | 2011-05-24 20:02:57 +0000 | [diff] [blame] | 96 | $(CC) $(AFLAGS) -c -o $@ $< |
| 97 | |
Chander Kashyap | 80b0af5 | 2011-06-02 18:07:32 +0000 | [diff] [blame] | 98 | $(obj)%.o: %.c |
Chander Kashyap | 7fc795f | 2011-05-24 20:02:57 +0000 | [diff] [blame] | 99 | $(CC) $(CFLAGS) -c -o $@ $< |
| 100 | |
| 101 | # defines $(obj).depend target |
| 102 | include $(SRCTREE)/rules.mk |
| 103 | |
| 104 | sinclude $(obj).depend |
| 105 | |
| 106 | ######################################################################### |