Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 1 | |
| 2 | include $(TOPDIR)/config.mk |
| 3 | include $(TOPDIR)/include/config.mk |
| 4 | include $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/config.mk |
| 5 | |
| 6 | LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds |
| 7 | LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS) |
| 8 | AFLAGS += -DCONFIG_ONENAND_IPL |
| 9 | CFLAGS += -DCONFIG_ONENAND_IPL |
| 10 | OBJCLFAGS += --gap-fill=0x00 |
| 11 | |
Kyungmin Park | 05d2318 | 2008-03-17 08:54:06 +0900 | [diff] [blame^] | 12 | SOBJS = start.o low_levelinit.o |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 13 | COBJS = apollon.o onenand_read.o onenand_boot.o |
| 14 | |
| 15 | SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c)) |
| 16 | OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) |
| 17 | __OBJS := $(SOBJS) $(COBJS) |
| 18 | LNDIR := $(OBJTREE)/onenand_ipl/board/$(BOARDDIR) |
| 19 | |
| 20 | onenandobj := $(OBJTREE)/onenand_ipl/ |
| 21 | |
Kyungmin Park | 05d2318 | 2008-03-17 08:54:06 +0900 | [diff] [blame^] | 22 | ALL = $(onenandobj)onenand-ipl $(onenandobj)onenand-ipl.bin $(onenandobj)onenand-ipl-2k.bin $(onenandobj)onenand-ipl-4k.bin |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 23 | |
| 24 | all: $(obj).depend $(ALL) |
| 25 | |
| 26 | $(onenandobj)onenand-ipl-2k.bin: $(onenandobj)onenand-ipl |
| 27 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=0x800 -O binary $< $@ |
| 28 | |
Kyungmin Park | 05d2318 | 2008-03-17 08:54:06 +0900 | [diff] [blame^] | 29 | $(onenandobj)onenand-ipl-4k.bin: $(onenandobj)onenand-ipl |
| 30 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=0x1000 -O binary $< $@ |
| 31 | |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 32 | $(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 | |
| 66 | include $(SRCTREE)/rules.mk |
| 67 | |
| 68 | sinclude $(obj).depend |