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 |
| 37 | CFLAGS += -DCONFIG_MMC_SPL |
| 38 | CFLAGS += -DCONFIG_PRELOADER |
| 39 | |
| 40 | SOBJS = start.o mem_setup.o lowlevel_init.o |
| 41 | COBJS = mmc_boot.o |
| 42 | |
| 43 | SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c)) |
| 44 | OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) |
| 45 | __OBJS := $(SOBJS) $(COBJS) |
| 46 | LNDIR := $(OBJTREE)/mmc_spl/board/$(BOARDDIR) |
| 47 | |
| 48 | mmcobj := $(OBJTREE)/mmc_spl/ |
| 49 | |
| 50 | |
| 51 | MKV310_MMC_SPL_EXEC = mkv310_mmc_spl_exec |
| 52 | MMC_SPL_BIN = u-boot-mmc-spl.bin |
| 53 | |
| 54 | ALL = $(mmcobj)u-boot-spl $(mmcobj)u-boot-spl.bin $(mmcobj)$(MMC_SPL_BIN) |
| 55 | |
| 56 | all: $(obj).depend $(ALL) |
| 57 | |
| 58 | $(mmcobj)$(MMC_SPL_BIN): $(mmcobj)u-boot-spl.bin tools/$(MKV310_MMC_SPL_EXEC) |
| 59 | ./tools/$(MKV310_MMC_SPL_EXEC) $(mmcobj)u-boot-spl.bin $(mmcobj)$(MMC_SPL_BIN) |
| 60 | rm -f tools/$(MKV310_MMC_SPL_EXEC) |
| 61 | |
| 62 | tools/$(MKV310_MMC_SPL_EXEC): tools/mkv310_image.c |
| 63 | $(HOSTCC) tools/mkv310_image.c -o tools/$(MKV310_MMC_SPL_EXEC) |
| 64 | |
| 65 | $(mmcobj)u-boot-spl.bin: $(mmcobj)u-boot-spl |
| 66 | $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ |
| 67 | |
| 68 | $(mmcobj)u-boot-spl: $(OBJS) $(mmcobj)u-boot.lds |
| 69 | cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \ |
| 70 | -Map $(mmcobj)u-boot-spl.map \ |
| 71 | -o $(mmcobj)u-boot-spl |
| 72 | |
| 73 | $(mmcobj)u-boot.lds: $(LDSCRIPT) |
| 74 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ |
| 75 | |
| 76 | # create symbolic links for common files |
| 77 | |
| 78 | # from cpu directory |
| 79 | $(obj)start.S: |
| 80 | @rm -f $@ |
| 81 | @ln -s $(TOPDIR)/arch/arm/cpu/armv7/start.S $@ |
| 82 | |
| 83 | # from board directory |
| 84 | $(obj)mem_setup.S: |
| 85 | @rm -f $@ |
| 86 | @ln -s $(TOPDIR)/board/samsung/smdkv310/mem_setup.S $@ |
| 87 | |
| 88 | $(obj)lowlevel_init.S: |
| 89 | @rm -f $@ |
| 90 | @ln -s $(TOPDIR)/board/samsung/smdkv310/lowlevel_init.S $@ |
| 91 | |
| 92 | ######################################################################### |
| 93 | |
| 94 | $(obj)%.o: $(obj)%.S |
| 95 | $(CC) $(AFLAGS) -c -o $@ $< |
| 96 | |
| 97 | $(obj)%.o: $(obj)%.c |
| 98 | $(CC) $(CFLAGS) -c -o $@ $< |
| 99 | |
| 100 | # defines $(obj).depend target |
| 101 | include $(SRCTREE)/rules.mk |
| 102 | |
| 103 | sinclude $(obj).depend |
| 104 | |
| 105 | ######################################################################### |