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
11LINKFLAGS = -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
18OBJECTS = head.o main.o
19BPOBJECTS = head.o bootp.o
20TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo
21VMLINUX = $(TOPDIR)/vmlinux
22OBJSTRIP = tools/objstrip
23
24all:	$(TARGETS)
25	@echo Ready to install kernel in $(shell pwd)/vmlinux.gz
26
27# normally no need to build these:
28rawboot: vmlinux.nh tools/lxboot tools/bootlx
29
30msb:	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
34bootimage:	tools/mkbb tools/lxboot tools/bootlx vmlinux.nh
35	( cat tools/lxboot tools/bootlx vmlinux.nh ) > bootimage
36	tools/mkbb bootimage tools/lxboot
37
38bootpfile:	tools/bootph vmlinux.nh
39	cat tools/bootph vmlinux.nh > bootpfile
40ifdef INITRD
41	cat $(INITRD) >> bootpfile
42endif
43
44srmboot:	bootdevice bootimage
45	dd if=bootimage of=$(BOOTDEV) bs=512 seek=1 skip=1
46	tools/mkbb $(BOOTDEV) tools/lxboot
47
48bootdevice:
49	@test "$(BOOTDEV)" != ""  || (echo You must specify BOOTDEV ; exit -1)
50
51vmlinux.gz: vmlinux
52	gzip -fv9 vmlinux
53
54main.o: ksize.h
55
56bootp.o: ksize.h
57
58ksize.h: vmlinux.nh dummy
59	echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $$5}'`" > $@T
60ifdef INITRD
61	[ -f $(INITRD) ] || exit 1
62	echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T
63endif
64	cmp -s $@T $@ || mv -f $@T $@
65	rm -f $@T
66
67vmlinux.nh: $(VMLINUX) $(OBJSTRIP)
68	$(OBJSTRIP) -v $(VMLINUX) vmlinux.nh
69
70vmlinux: $(TOPDIR)/vmlinux
71	$(STRIP) -o vmlinux $(VMLINUX)
72
73tools/lxboot: $(OBJSTRIP) bootloader
74	$(OBJSTRIP) -p bootloader tools/lxboot
75
76tools/bootlx: bootloader $(OBJSTRIP)
77	$(OBJSTRIP) -vb bootloader tools/bootlx
78
79tools/bootph: bootpheader $(OBJSTRIP)
80	$(OBJSTRIP) -vb bootpheader tools/bootph
81
82$(OBJSTRIP): $(OBJSTRIP).c
83	$(HOSTCC) $(HOSTCFLAGS) -I$(HPATH) $(OBJSTRIP).c -o $(OBJSTRIP)
84
85tools/mkbb: tools/mkbb.c
86	$(HOSTCC) tools/mkbb.c -o tools/mkbb
87
88bootloader: $(OBJECTS)
89	$(LD) $(LINKFLAGS) $(OBJECTS) $(LIBS) -o bootloader
90
91bootpheader: $(BPOBJECTS)
92	$(LD) $(LINKFLAGS) $(BPOBJECTS) $(LIBS) -o bootpheader
93
94clean:
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
99dep:
100
101dummy:
102