summaryrefslogtreecommitdiffstats
path: root/arch/ppc/treeboot/Makefile
blob: 7d42a674182d31ec2c6d843e7f39616da4f9cbfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
#    Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
#
#    Module name: Makefile
#
#    Description:
#      Makefile for the IBM "tree" evaluation board Linux kernel
#      boot loaders.
#

HOSTCFLAGS = -O -I$(TOPDIR)/include

GZIP	= gzip -vf9
RM	= rm -f
MKEVIMG	= mkevimg -l
MKIRIMG	= mkirimg

CFLAGS	= -O -fno-builtin -I$(TOPDIR)/include
LD_ARGS = -e _start -T ld.script -Ttext 0x00200000 -Bstatic

OBJS	= crt0.o main.o misc.o irSect.o ../coffboot/string.o ../coffboot/zlib.o 
LIBS	=

treeboot: $(OBJS) ld.script
	$(LD) -o $@ $(LD_ARGS) $(OBJS) $(LIBS)

zImage:	vmlinux.img

zImage.initrd: vmlinux.initrd.img

treeboot.image: treeboot vmlinux.gz
	$(OBJCOPY) --add-section=image=vmlinux.gz treeboot $@

treeboot.initrd: treeboot.image ramdisk.image.gz
	$(OBJCOPY) --add-section=initrd=ramdisk.image.gz treeboot.image $@

vmlinux.img: treeboot.image
	$(OBJDUMP) --syms treeboot.image | grep irSectStart > irSectStart.txt
	$(MKIRIMG) treeboot.image treeboot.image.out irSectStart.txt
	$(MKEVIMG) treeboot.image.out $@
	$(RM) treeboot.image treeboot.image.out irSectStart.txt

vmlinux.initrd.img: treeboot.initrd
	$(OBJDUMP) --all-headers treeboot.initrd | grep irSectStart > irSectStart.txt
	$(MKIRIMG) treeboot.initrd treeboot.initrd.out irSectStart.txt
	$(MKEVIMG) treeboot.initrd.out $@
	$(RM) treeboot.initrd treeboot.initrd.out irSectStart.txt

vmlinux.gz: $(TOPDIR)/vmlinux
	$(OBJCOPY) -S -O binary $(TOPDIR)/vmlinux vmlinux
	$(GZIP) vmlinux

clean:
	rm -f treeboot treeboot.image treeboot.initrd irSectStart.txt vmlinux.* *.o

fastdep: