2 # Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
4 # Module name: Makefile
7 # Makefile for the IBM "tree" evaluation board Linux kernel
11 HOSTCFLAGS
= -O
-I
$(TOPDIR
)/include
13 CC
= $(CROSS_COMPILE
)gcc
14 LD
= $(CROSS_COMPILE
)ld
15 OBJCOPY
= $(CROSS_COMPILE
)objcopy
16 OBJDUMP
= $(CROSS_COMPILE
)objdump
23 CFLAGS
= -O
-fno-builtin
-I
$(TOPDIR
)/include
24 LD_ARGS
= -e _start
-T
ld.script
-Ttext
0x00200000 -Bstatic
26 OBJS
= crt0.o main.o misc.o irSect.o ..
/coffboot
/string.o ..
/coffboot
/zlib.o
29 treeboot
: $(OBJS
) ld.script
30 $(LD
) -o
$@
$(LD_ARGS
) $(OBJS
) $(LIBS
)
34 zImage.initrd
: vmlinux.initrd.img
36 treeboot.image
: treeboot vmlinux.gz
37 $(OBJCOPY
) --add-section
=image
=vmlinux.gz treeboot
$@
39 treeboot.initrd
: treeboot.image ramdisk.image.gz
40 $(OBJCOPY
) --add-section
=initrd
=ramdisk.image.gz treeboot.image
$@
42 vmlinux.img
: treeboot.image
43 $(OBJDUMP
) --syms treeboot.image | grep irSectStart
> irSectStart.txt
44 $(MKIRIMG
) treeboot.image treeboot.image.out irSectStart.txt
45 $(MKEVIMG
) treeboot.image.out
$@
46 $(RM
) treeboot.image treeboot.image.out irSectStart.txt
48 vmlinux.initrd.img
: treeboot.initrd
49 $(OBJDUMP
) --all-headers treeboot.initrd | grep irSectStart
> irSectStart.txt
50 $(MKIRIMG
) treeboot.initrd treeboot.initrd.out irSectStart.txt
51 $(MKEVIMG
) treeboot.initrd.out
$@
52 $(RM
) treeboot.initrd treeboot.initrd.out irSectStart.txt
54 vmlinux.gz
: $(TOPDIR
)/vmlinux
55 $(OBJCOPY
) -S
-O binary
$(TOPDIR
)/vmlinux vmlinux
59 rm -f treeboot treeboot.image treeboot.initrd irSectStart.txt vmlinux.
* *.o