Added boot carrier for freeldr. I'm at the point where I need to do
[reactos.git] / reactos / boot / freeldr / bootsect / Makefile.powerpc
1 TOOLS=$(PATH_TO_TOP)/tools
2 SECTIONS= \
3 --only-section=.text \
4 --only-section=.data \
5 --only-section=.bss
6 LDSECT= -Ttext 0xe00000 -Tdata 0xe10000
7 OBJS=ofwboot.o freeldr.o
8 CFLAGS=-mbig -meabi -fPIC -fno-builtin -I../freeldr/include
9 FREELDR=../freeldr/freeldr.sys
10
11 .SUFFIXES: .c .o
12
13 all: ofwldr
14
15 hack-coff$(EXEEXT):
16 $(HOST_CC) -I../freeldr/include hack-coff.c -o $@
17
18 ofwboot.o: ofwboot.s
19 $(NASM_CMD) $< -c -o $@
20
21 $(FREELDR):
22 $(MAKE) -C ../freeldr
23
24 freeldr.o: $(FREELDR)
25 $(TOOLS)/ppc-le2be $< freeldr.tmp
26 $(OBJCOPY) -I binary -O elf32-powerpc -B powerpc:common freeldr.tmp $@
27 rm freeldr.tmp
28
29 ofwldr: $(OBJS)
30 mppcw32-ld --no-omagic $(LDSECT) $(OBJS) -g -o $@.elf
31 mppcw32-objcopy $(SECTIONS) -O aixcoff-rs6000 $@.elf $@
32 $(TOOLS)/hack-coff $@
33
34 clean:
35 rm -rf ofwldr *.o *.elf *.tmp