2 # Samsung Universal(S5PC110) board Recovery block
4 # Copyright (C) 2010 Samsung Electronics
5 # Minkyu Kang <mk7.kang@samsung.com>
6 # Kyungmin Park <kyungmin.park@samsung.com>
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
14 include $(TOPDIR)/config.mk
16 recoveryobj := $(OBJTREE)/recovery/
17 RECOVERYCFG := $(recoveryobj)board/$(BOARDDIR)/config.mk
18 include $(RECOVERYCFG)
20 LDSCRIPT = board/$(BOARDDIR)/recovery.lds
21 LDSCRIPT := $(addprefix $(recoveryobj),$(LDSCRIPT))
22 LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
23 OBJCFLAGS += --gap-fill=0x00
30 OBJS := $(addprefix $(obj),$(OBJS))
32 LIBS = drivers/onenand/libonenand.a
33 LIBS := $(addprefix $(recoveryobj),$(LIBS))
35 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
36 LIBBOARD := $(addprefix $(recoveryobj),$(LIBBOARD))
39 PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
41 __OBJS := $(subst $(obj),,$(OBJS))
42 __LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
44 #########################################################################
45 #########################################################################
47 ALL = $(recoveryobj)recovery-256k.bin
49 all: $(obj).depend $(ALL)
51 $(recoveryobj)recovery-256k.bin: $(recoveryobj)recovery
52 $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(TEXT_BASE_256K) -O binary $< $@
53 cat $(OBJTREE)/onenand_ipl/onenand-ipl-16k-evt0.bin $@ > $(recoveryobj)recovery-evt0.bin
54 cat $(OBJTREE)/onenand_ipl/onenand-ipl-16k-fused.bin $@ > $(recoveryobj)recovery-fused.bin
55 cat $(OBJTREE)/onenand_ipl/onenand-ipl-16k.bin $@ > $(recoveryobj)recovery.bin
57 $(recoveryobj)recovery: $(obj).depend $(OBJS) $(LIBS) $(LIBBOARD) $(RECOVERYCFG)
58 $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
59 --start-group $(__LIBS) --end-group $(PLATFORM_LIBGCC) \
63 $(MAKE) -C $(dir $(subst $(obj),,$@))
66 $(MAKE) -C $(dir $(subst $(obj),,$@))
68 #########################################################################
70 include $(SRCTREE)/rules.mk
72 sinclude $(obj).depend
74 #########################################################################