blob: f10ed02292ab83290437676bf9310105b5f44eb5 [file] [log] [blame]
Kyungmin Park33174212008-01-17 16:43:25 +09001
2include $(TOPDIR)/config.mk
3include $(TOPDIR)/include/config.mk
4include $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/config.mk
5
6LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds
7LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
8AFLAGS += -DCONFIG_ONENAND_IPL
9CFLAGS += -DCONFIG_ONENAND_IPL
10OBJCLFAGS += --gap-fill=0x00
11
Kyungmin Park05d23182008-03-17 08:54:06 +090012SOBJS = start.o low_levelinit.o
Kyungmin Park33174212008-01-17 16:43:25 +090013COBJS = apollon.o onenand_read.o onenand_boot.o
14
15SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
16OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
17__OBJS := $(SOBJS) $(COBJS)
18LNDIR := $(OBJTREE)/onenand_ipl/board/$(BOARDDIR)
19
20onenandobj := $(OBJTREE)/onenand_ipl/
21
Kyungmin Park05d23182008-03-17 08:54:06 +090022ALL = $(onenandobj)onenand-ipl $(onenandobj)onenand-ipl.bin $(onenandobj)onenand-ipl-2k.bin $(onenandobj)onenand-ipl-4k.bin
Kyungmin Park33174212008-01-17 16:43:25 +090023
24all: $(obj).depend $(ALL)
25
26$(onenandobj)onenand-ipl-2k.bin: $(onenandobj)onenand-ipl
27 $(OBJCOPY) ${OBJCFLAGS} --pad-to=0x800 -O binary $< $@
28
Kyungmin Park05d23182008-03-17 08:54:06 +090029$(onenandobj)onenand-ipl-4k.bin: $(onenandobj)onenand-ipl
30 $(OBJCOPY) ${OBJCFLAGS} --pad-to=0x1000 -O binary $< $@
31
Kyungmin Park33174212008-01-17 16:43:25 +090032$(onenandobj)onenand-ipl.bin: $(onenandobj)onenand-ipl
33 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
34
35$(onenandobj)onenand-ipl: $(OBJS)
36 cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
37 -Map $(onenandobj)onenand-ipl.map \
38 -o $(onenandobj)onenand-ipl
39
40# create symbolic links from common files
41
42# from cpu directory
43$(obj)start.S:
44 rm -f $(obj)start.S
45 ln -s $(SRCTREE)/cpu/$(CPU)/start.S $(obj)start.S
46
47# from onenand_ipl directory
48$(obj)onenand_ipl.h:
49 rm -f $(obj)onenand_ipl.h
50 ln -s $(SRCTREE)/onenand_ipl/onenand_ipl.h $(obj)onenand_ipl.h
51
52$(obj)onenand_boot.c: $(obj)onenand_ipl.h
53 rm -f $(obj)onenand_boot.c
54 ln -s $(SRCTREE)/onenand_ipl/onenand_boot.c $(obj)onenand_boot.c
55
56$(obj)onenand_read.c: $(obj)onenand_ipl.h
57 rm -f $(obj)onenand_read.c
58 ln -s $(SRCTREE)/onenand_ipl/onenand_read.c $(obj)onenand_read.c
59
60$(obj)%.o: $(obj)%.S
61 $(CC) $(AFLAGS) -c -o $@ $<
62
63$(obj)%.o: $(obj)$.c
64 $(CC) $(CFLAGS) -c -o $@ $<
65
66include $(SRCTREE)/rules.mk
67
68sinclude $(obj).depend