pre-2.3.4..
[davej-history.git] / arch / ppc / coffboot / Makefile
blob9151717467801d0f5514f02d0c5e84568009ee62
1 # Makefile for making XCOFF bootable images for booting on PowerMacs
2 # using Open Firmware.
4 # Paul Mackerras January 1997
6 HOSTCC = gcc
7 HOSTCFLAGS = -O -I$(TOPDIR)/include
9 CC = $(CROSS_COMPILE)gcc
10 LD = $(CROSS_COMPILE)ld
11 CFLAGS = -O -fno-builtin -I$(TOPDIR)/include
12 OBJCOPY = $(CROSS_COMPILE)objcopy
13 OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment \
14 --add-section=image=vmlinux.gz
15 LD_ARGS = -e _start -T ld.script -Ttext 500000 -Tdata 510000 -Bstatic
16 GZ = gzip -9
18 OBJS = crt0.o start.o main.o misc.o string.o zlib.o
19 LIBS = $(TOPDIR)/lib/lib.a
21 ifeq ($(CONFIG_ALL_PPC),y)
22 # yes, we want to build pmac stuff
23 CONFIG_PMAC = y
24 endif
26 ifeq ($(CONFIG_PPC64),y)
27 MSIZE=.64
28 else
29 MSIZE=
30 endif
32 ifeq ($(CONFIG_SMP),y)
33 TFTPIMAGE=/tftpboot/zImage.pmac.smp$(MSIZE)
34 else
35 TFTPIMAGE=/tftpboot/zImage.pmac$(MSIZE)
36 endif
38 ifeq ($(CONFIG_PMAC),y)
39 hack-coff: hack-coff.c
40 $(HOSTCC) $(HOSTCFLAGS) -o hack-coff hack-coff.c
42 floppy: zImage
43 # mount -t hfs /dev/fd0 /mnt
44 # cp vmlinux.coff /mnt
45 # umount /mnt
47 znetboot: vmlinux.coff
48 cp vmlinux.coff $(TFTPIMAGE)
50 znetboot.initrd: vmlinux.coff.initrd
51 cp vmlinux.coff.initrd $(TFTPIMAGE)
53 coffboot: $(OBJS) ld.script
54 $(LD) -o coffboot $(LD_ARGS) $(OBJS) $(LIBS)
56 zImage: vmlinux.coff
58 zImage.initrd: vmlinux.coff.initrd
60 vmlinux.coff: coffboot hack-coff vmlinux.gz
61 $(OBJCOPY) $(OBJCOPY_ARGS) coffboot $@
62 ./hack-coff $@
63 ln -sf vmlinux.coff zImage
65 vmlinux.coff.initrd: coffboot hack-coff vmlinux.gz ramdisk.image.gz
66 $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=initrd=ramdisk.image.gz \
67 coffboot $@
68 ./hack-coff $@
70 else
71 znetboot: vmlinux.gz
73 znetboot.initrd: vmlinux.gz
75 coffboot: vmlinux.gz
77 zImage: vmlinux.gz
79 zImage.initrd: vmlinux.gz
81 vmlinux.coff: vmlinux.gz
83 vmlinux.coff.initrd: vmlinux.gz
85 floppy: vmlinux.gz
87 endif
89 vmlinux.gz: $(TOPDIR)/vmlinux
90 $(OBJCOPY) -S -O binary $(TOPDIR)/vmlinux vmlinux
91 gzip -vf9 vmlinux
93 clean:
94 rm -f hack-coff coffboot zImage vmlinux.coff vmlinux.gz
96 fastdep: