Import 2.3.9pre7
[davej-history.git] / arch / ppc / coffboot / Makefile
blob81e21f3e3814ac2d1cbf95e31da47060e0f56e96
1 # Makefile for making XCOFF bootable images for booting on PowerMacs
2 # using Open Firmware.
4 # Paul Mackerras January 1997
6 HOSTCFLAGS = -O -I$(TOPDIR)/include
8 CC = $(CROSS_COMPILE)gcc
9 LD = $(CROSS_COMPILE)ld
10 CFLAGS = -O -fno-builtin -I$(TOPDIR)/include
11 OBJCOPY = $(CROSS_COMPILE)objcopy
12 OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment \
13 --add-section=image=vmlinux.gz
14 LD_ARGS = -e _start -T ld.script -Ttext 500000 -Tdata 510000 -Bstatic
15 GZ = gzip -9
17 OBJS = crt0.o start.o main.o misc.o string.o zlib.o
18 LIBS = $(TOPDIR)/lib/lib.a
20 ifeq ($(CONFIG_ALL_PPC),y)
21 # yes, we want to build pmac stuff
22 CONFIG_PMAC = y
23 endif
25 ifeq ($(CONFIG_PPC64),y)
26 MSIZE=.64
27 else
28 MSIZE=
29 endif
31 ifeq ($(CONFIG_SMP),y)
32 TFTPIMAGE=/tftpboot/zImage.pmac.smp$(MSIZE)
33 else
34 TFTPIMAGE=/tftpboot/zImage.pmac$(MSIZE)
35 endif
37 ifeq ($(CONFIG_PMAC),y)
38 hack-coff: hack-coff.c
39 $(HOSTCC) $(HOSTCFLAGS) -o hack-coff hack-coff.c
41 floppy: zImage
42 # mount -t hfs /dev/fd0 /mnt
43 # cp vmlinux.coff /mnt
44 # umount /mnt
46 znetboot: vmlinux.coff
47 cp vmlinux.coff $(TFTPIMAGE)
49 znetboot.initrd: vmlinux.coff.initrd
50 cp vmlinux.coff.initrd $(TFTPIMAGE)
52 coffboot: $(OBJS) ld.script
53 $(LD) -o coffboot $(LD_ARGS) $(OBJS) $(LIBS)
55 zImage: vmlinux.coff
57 zImage.initrd: vmlinux.coff.initrd
59 vmlinux.coff: coffboot hack-coff vmlinux.gz
60 $(OBJCOPY) $(OBJCOPY_ARGS) coffboot $@
61 ./hack-coff $@
62 ln -sf vmlinux.coff zImage
64 vmlinux.coff.initrd: coffboot hack-coff vmlinux.gz ramdisk.image.gz
65 $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=initrd=ramdisk.image.gz \
66 coffboot $@
67 ./hack-coff $@
69 else
70 znetboot: vmlinux.gz
72 znetboot.initrd: vmlinux.gz
74 coffboot: vmlinux.gz
76 zImage: vmlinux.gz
78 zImage.initrd: vmlinux.gz
80 vmlinux.coff: vmlinux.gz
82 vmlinux.coff.initrd: vmlinux.gz
84 floppy: vmlinux.gz
86 endif
88 vmlinux.gz: $(TOPDIR)/vmlinux
89 $(OBJCOPY) -S -O binary $(TOPDIR)/vmlinux vmlinux
90 gzip -vf9 vmlinux
92 clean:
93 rm -f hack-coff coffboot zImage vmlinux.coff vmlinux.gz
95 fastdep: