1#
2# This file is subject to the terms and conditions of the GNU General Public
3# License.  See the file "COPYING" in the main directory of this archive
4# for more details.
5#
6# Copyright (C) 1995, 1998, 1999 by Ralf Baechle
7# Copyright (C) 2004  Maciej W. Rozycki
8#
9
10USE_STANDARD_AS_RULE := true
11
12#
13# Some DECstations need all possible sections of an ECOFF executable
14#
15ifdef CONFIG_DECSTATION
16  E2EFLAGS = -a
17else
18  E2EFLAGS =
19endif
20
21#
22# Drop some uninteresting sections in the kernel.
23# This is only relevant for ELF kernels but doesn't hurt a.out
24#
25drop-sections	= .reginfo .mdebug .comment .note .pdr .options .MIPS.options
26strip-flags	= $(addprefix --remove-section=,$(drop-sections))
27
28VMLINUX = $(TOPDIR)/vmlinux
29
30all:
31
32boot: vmlinux.ecoff vmlinux.srec addinitrd
33
34vmlinux.ecoff: $(CONFIGURE) elf2ecoff $(VMLINUX)
35	./elf2ecoff $(VMLINUX) vmlinux.ecoff $(E2EFLAGS)
36
37elf2ecoff: $(TOPDIR)/arch/mips/boot/elf2ecoff.c
38	$(HOSTCC) -I$(TOPDIR)/arch/mips/boot -I- -o $@ $^
39
40vmlinux.srec: $(CONFIGURE) $(VMLINUX)
41	$(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) vmlinux.srec
42
43addinitrd: $(TOPDIR)/arch/mips/boot/addinitrd.c
44	$(HOSTCC) -I$(TOPDIR)/arch/mips/boot -I- -o $@ $^
45
46# Don't build dependencies, this may die if $(CC) isn't gcc
47dep:
48
49clean:
50	rm -f vmlinux.ecoff vmlinux.srec
51
52mrproper:
53	rm -f vmlinux.ecoff vmlinux.srec addinitrd elf2ecoff
54
55dummy:
56
57include $(TOPDIR)/Rules.make
58