1 # *****************************************************************************
2 # * Copyright (c) 2004, 2008 IBM Corporation
3 # * All rights reserved.
4 # * This program and the accompanying materials
5 # * are made available under the terms of the BSD License
6 # * which accompanies this distribution, and is available at
7 # * http://www.opensource.org/licenses/bsd-license.php
10 # * IBM Corporation - initial implementation
11 # ****************************************************************************/
13 include ../../make.rules
15 CPPFLAGS = -I$(INCLBRDDIR) -I$(INCLCMNDIR) -I$(INCLCMNDIR)/$(CPUARCH) \
16 -I$(LIBCMNDIR)/libc/include
17 CFLAGS += -fno-builtin $(CPPFLAGS) -O2 -msoft-float $(MAMBO)
18 CFLAGS += $(BOOT) $(IOCONF) -Wa,-mregnames $(RELEASE) $(CPUARCHDEF) -Wall
19 ASFLAGS = $(BOOT) $(IOCONF) $(RELEASE)$(CPUARCHDEF) -Wa,-mregnames
20 LDFLAGS1 = -nostdlib -e__start -Tstage2.lds -N -Ttext=0x100
23 STG1OBJ = startup.o boot_abort.o romfs.o hw.o io_generic.o board_io.o
24 STG1OBJ += stage2_head.o stage2.o comlib.o romfs_wrap.o nvramlog.o
27 all: stage1.bin stageS.bin Cboot.o
29 stage1.bin: $(STG1OBJ) $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libc.a
30 $(LD) $(LDFLAGS1) -o stage1.elf $^
31 $(OBJCOPY) -O binary stage1.elf $@
34 $(LD) -nostdlib -N -Tstage_s.lds -o stage_s.elf stage_s.o
35 $(OBJCOPY) -O binary stage_s.elf stageS.bin
37 romfs.o: ../../llfw/romfs.S
38 $(CC) $(CFLAGS) -c ../../llfw/romfs.S
40 boot_abort.o: ../../llfw/boot_abort.S
41 $(CC) $(CFLAGS) -c ../../llfw/boot_abort.S
43 nvramlog.o: ../../llfw/nvramlog.S
44 $(CC) $(CFLAGS) -c ../../llfw/nvramlog.S
46 include $(LLFWCMNDIR)/clib/Makefile.inc
48 include $(LLFWCMNDIR)/io_generic/Makefile.inc
50 romfs_wrap.o: ../../llfw/romfs_wrap.c
51 $(CC) $(CFLAGS) -c ../../llfw/romfs_wrap.c
55 $(OBJCOPY) -O binary Cboot.o Cboot.bin