Import changeset
[linux-flexiantxendom0-3.2.10.git] / arch / alpha / boot / Makefile
1 #
2 # arch/alpha/boot/Makefile
3 #
4 # This file is subject to the terms and conditions of the GNU General Public
5 # License.  See the file "COPYING" in the main directory of this archive
6 # for more details.
7 #
8 # Copyright (C) 1994 by Linus Torvalds
9 #
10
11 LINKFLAGS = -static -T bootloader.lds #-N -relax
12
13 .S.s:
14         $(CPP) $(AFLAGS) -traditional -o $*.o $<
15 .S.o:
16         $(CC) $(AFLAGS) -traditional -c -o $*.o $<
17
18 OBJECTS = head.o main.o
19 BPOBJECTS = head.o bootp.o
20 TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo
21 VMLINUX = $(TOPDIR)/vmlinux
22 OBJSTRIP = tools/objstrip
23
24 all:    $(TARGETS)
25         @echo Ready to install kernel in $(shell pwd)/vmlinux.gz
26
27 # normally no need to build these:
28 rawboot: vmlinux.nh tools/lxboot tools/bootlx
29
30 msb:    tools/lxboot tools/bootlx vmlinux.nh
31         ( cat tools/lxboot tools/bootlx vmlinux.nh ) > /dev/rz0a
32         disklabel -rw rz0 'linux' tools/lxboot tools/bootlx
33
34 bootimage:      tools/mkbb tools/lxboot tools/bootlx vmlinux.nh
35         ( cat tools/lxboot tools/bootlx vmlinux.nh ) > bootimage
36         tools/mkbb bootimage tools/lxboot
37
38 bootpfile:      tools/bootph vmlinux.nh
39         cat tools/bootph vmlinux.nh > bootpfile
40 ifdef INITRD
41         cat $(INITRD) >> bootpfile
42 endif
43
44 srmboot:        bootdevice bootimage
45         dd if=bootimage of=$(BOOTDEV) bs=512 seek=1 skip=1
46         tools/mkbb $(BOOTDEV) tools/lxboot
47
48 bootdevice:
49         @test "$(BOOTDEV)" != ""  || (echo You must specify BOOTDEV ; exit -1)
50
51 vmlinux.gz: vmlinux
52         gzip -fv9 vmlinux
53
54 main.o: ksize.h
55
56 bootp.o: ksize.h
57
58 ksize.h: vmlinux.nh dummy
59         echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $$5}'`" > $@T
60 ifdef INITRD
61         [ -f $(INITRD) ] || exit 1
62         echo "#define INITRD_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T
63 endif
64         cmp -s $@T $@ || mv -f $@T $@
65         rm -f $@T
66
67 vmlinux.nh: $(VMLINUX) $(OBJSTRIP)
68         $(OBJSTRIP) -v $(VMLINUX) vmlinux.nh
69
70 vmlinux: $(TOPDIR)/vmlinux
71         $(STRIP) -o vmlinux $(VMLINUX)
72
73 tools/lxboot: $(OBJSTRIP) bootloader
74         $(OBJSTRIP) -p bootloader tools/lxboot
75
76 tools/bootlx: bootloader $(OBJSTRIP)
77         $(OBJSTRIP) -vb bootloader tools/bootlx
78
79 tools/bootph: bootpheader $(OBJSTRIP)
80         $(OBJSTRIP) -vb bootpheader tools/bootph
81
82 $(OBJSTRIP): $(OBJSTRIP).c
83         $(HOSTCC) $(HOSTCFLAGS) -I$(HPATH) $(OBJSTRIP).c -o $(OBJSTRIP)
84
85 tools/mkbb: tools/mkbb.c
86         $(HOSTCC) tools/mkbb.c -o tools/mkbb
87
88 bootloader: $(OBJECTS)
89         $(LD) $(LINKFLAGS) $(OBJECTS) $(LIBS) -o bootloader
90
91 bootpheader: $(BPOBJECTS)
92         $(LD) $(LINKFLAGS) $(BPOBJECTS) $(LIBS) -o bootpheader
93
94 clean:
95         rm -f $(TARGETS) bootloader bootimage bootpfile bootpheader
96         rm -f tools/mkbb tools/bootlx tools/lxboot tools/bootph
97         rm -f vmlinux.nh ksize.h
98
99 dep:
100
101 dummy: