Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 1 | |
| 2 | include $(TOPDIR)/config.mk |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 3 | include $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/config.mk |
| 4 | |
| 5 | LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 6 | LDFLAGS = -Bstatic -T $(onenandobj)u-boot.lds -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS) |
Magnus Lilja | 1ec96d8 | 2009-06-13 20:50:00 +0200 | [diff] [blame] | 7 | AFLAGS += -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL |
| 8 | CFLAGS += -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL |
Shinya Kuribayashi | 28e4d04 | 2009-06-07 21:45:16 +0900 | [diff] [blame] | 9 | OBJCFLAGS += --gap-fill=0x00 |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 10 | |
Stefan Roese | 3762825 | 2008-08-06 14:05:38 +0200 | [diff] [blame] | 11 | SOBJS := low_levelinit.o |
| 12 | SOBJS += start.o |
| 13 | COBJS := apollon.o |
| 14 | COBJS += onenand_read.o |
| 15 | COBJS += onenand_boot.o |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 16 | |
| 17 | SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c)) |
| 18 | OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) |
| 19 | __OBJS := $(SOBJS) $(COBJS) |
| 20 | LNDIR := $(OBJTREE)/onenand_ipl/board/$(BOARDDIR) |
| 21 | |
| 22 | onenandobj := $(OBJTREE)/onenand_ipl/ |
| 23 | |
Kyungmin Park | 05d2318 | 2008-03-17 08:54:06 +0900 | [diff] [blame] | 24 | 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] | 25 | |
| 26 | all: $(obj).depend $(ALL) |
| 27 | |
| 28 | $(onenandobj)onenand-ipl-2k.bin: $(onenandobj)onenand-ipl |
| 29 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=0x800 -O binary $< $@ |
| 30 | |
Kyungmin Park | 05d2318 | 2008-03-17 08:54:06 +0900 | [diff] [blame] | 31 | $(onenandobj)onenand-ipl-4k.bin: $(onenandobj)onenand-ipl |
| 32 | $(OBJCOPY) ${OBJCFLAGS} --pad-to=0x1000 -O binary $< $@ |
| 33 | |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 34 | $(onenandobj)onenand-ipl.bin: $(onenandobj)onenand-ipl |
| 35 | $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ |
| 36 | |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 37 | $(onenandobj)onenand-ipl: $(OBJS) $(onenandobj)u-boot.lds |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 38 | cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \ |
Stefan Roese | 3762825 | 2008-08-06 14:05:38 +0200 | [diff] [blame] | 39 | -Map $@.map -o $@ |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 40 | |
Wolfgang Denk | 18d46c0 | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 41 | $(onenandobj)u-boot.lds: $(LDSCRIPT) |
| 42 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ |
| 43 | |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 44 | # create symbolic links from common files |
| 45 | |
| 46 | # from cpu directory |
| 47 | $(obj)start.S: |
Stefan Roese | 3762825 | 2008-08-06 14:05:38 +0200 | [diff] [blame] | 48 | @rm -f $@ |
| 49 | ln -s $(SRCTREE)/cpu/$(CPU)/start.S $@ |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 50 | |
| 51 | # from onenand_ipl directory |
| 52 | $(obj)onenand_ipl.h: |
Stefan Roese | 3762825 | 2008-08-06 14:05:38 +0200 | [diff] [blame] | 53 | @rm -f $@ |
| 54 | ln -s $(SRCTREE)/onenand_ipl/onenand_ipl.h $@ |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 55 | |
| 56 | $(obj)onenand_boot.c: $(obj)onenand_ipl.h |
Stefan Roese | 3762825 | 2008-08-06 14:05:38 +0200 | [diff] [blame] | 57 | @rm -f $@ |
| 58 | ln -s $(SRCTREE)/onenand_ipl/onenand_boot.c $@ |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 59 | |
| 60 | $(obj)onenand_read.c: $(obj)onenand_ipl.h |
Stefan Roese | 3762825 | 2008-08-06 14:05:38 +0200 | [diff] [blame] | 61 | @rm -f $@ |
| 62 | ln -s $(SRCTREE)/onenand_ipl/onenand_read.c $@ |
| 63 | |
| 64 | ifneq ($(OBJTREE), $(SRCTREE)) |
| 65 | $(obj)apollon.c: |
| 66 | @rm -f $@ |
| 67 | ln -s $(SRCTREE)/onenand_ipl/board/$(BOARDDIR)/apollon.c $@ |
| 68 | |
| 69 | $(obj)low_levelinit.S: |
| 70 | @rm -f $@ |
| 71 | ln -s $(SRCTREE)/onenand_ipl/board/$(BOARDDIR)/low_levelinit.S $@ |
| 72 | endif |
| 73 | |
| 74 | ######################################################################### |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 75 | |
| 76 | $(obj)%.o: $(obj)%.S |
| 77 | $(CC) $(AFLAGS) -c -o $@ $< |
| 78 | |
| 79 | $(obj)%.o: $(obj)$.c |
| 80 | $(CC) $(CFLAGS) -c -o $@ $< |
| 81 | |
Stefan Roese | 3762825 | 2008-08-06 14:05:38 +0200 | [diff] [blame] | 82 | # defines $(obj).depend target |
Kyungmin Park | 3317421 | 2008-01-17 16:43:25 +0900 | [diff] [blame] | 83 | include $(SRCTREE)/rules.mk |
| 84 | |
| 85 | sinclude $(obj).depend |
Stefan Roese | 3762825 | 2008-08-06 14:05:38 +0200 | [diff] [blame] | 86 | |
| 87 | ######################################################################### |