1 # *****************************************************************************
2 # * Copyright (c) 2004, 2011 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 $(TOPCMNDIR)/make.rules
15 SNKDIR = $(TOPCMNDIR)/clients/net-snk
17 CFLAGS += -fno-builtin -I$(LIBCMNDIR)/libc/include
18 CFLAGS += -I$(SNKDIR)/include -I. $(CPUARCHDEF)
19 CFLAGS += -I$(INCLBRDDIR) -I$(INCLCMNDIR) -I$(INCLCMNDIR)/$(CPUARCH)
20 CFLAGS += -O2 -msoft-float -Wa,-mregnames $(RELEASE)
22 OBJS = $(SNKDIR)/kernel/kernel.o
23 OBJS += $(SNKDIR)/oflib/oflib.o
24 OBJS += $(SNKDIR)/libc/time/timer.o
25 OBJS += entry.o main.o of.elf takeover.o
26 OBJS += $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libc.a
33 takeover.elf: ppc32wrap.o takeover.elf32
34 @echo " ====== Building $@ ======"
35 $(LD) -N -melf32ppclinux -static -nostdlib \
36 -Ttext=0x400000 -Tdata=0x400100 \
39 takeover.elf64: entry.o main.o takeover.o $(SNKDIR)/libc/time/timer.o of.elf
40 $(MAKE) -C $(LIBCMNDIR) libc
41 $(MAKE) -C $(CLIENTSDIR)
42 $(LD) $(LDFLAGS) -o $@ -Tclient.lds $(OBJS)
44 of.elf: ../../boot_rom.bin
45 $(OBJCOPY) --input-target=binary --binary-architecture=powerpc -O elf64-powerpc $< $@
47 takeover.elf32: takeover.elf64
48 $(OBJCOPY) -O binary $^ takeover.tmp
49 $(OBJCOPY) --input-target=binary --binary-architecture=powerpc -O elf32-powerpc takeover.tmp $@
51 ppc32wrap.o: ppc32wrap.S
52 $(CROSS)gcc -m32 $(CFLAGS) -c $< -o $@
55 $(MAKE) -C $(LIBCMNDIR) $@
56 $(MAKE) -C $(CLIENTSDIR) $@
58 $(RM) takeover.elf32 takeover.elf64 takeover.tmp