clean
[linux-2.4.21-pre4.git] / arch / ppc / boot / Makefile
1 #
2 # arch/ppc/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 # Adapted for PowerPC by Gary Thomas
10 # modified by Cort (cort@cs.nmt.edu)
11 #
12
13 GZIP_FLAGS = -v9f
14
15 CFLAGS  += -fno-builtin -D__BOOTER__ -I$(TOPDIR)/arch/$(ARCH)/boot/include
16
17 AFLAGS  += -D__BOOTER__
18 OBJCOPY_ARGS = -O elf32-powerpc
19
20 MKIMAGE                         := ./utils/mkimage.wrapper
21
22 lib/zlib.a: lib/zlib.c
23         $(MAKE) -C lib
24
25 images/vmlinux.gz: $(TOPDIR)/vmlinux
26         $(MAKE) -C images vmlinux.gz
27
28 # Subdirs and tools needed for each.  Assume we always need to go into
29 # 'simple' unless told otherwise.
30 subdir-y                        := lib common simple
31 subdir-$(CONFIG_ALL_PPC)        := chrp pmac prep
32 tools-$(CONFIG_ALL_PPC)         := addnote mknote hack-coff mkprep
33 tools-$(CONFIG_PPLUS)           := mkbugboot mkprep
34 tools-$(CONFIG_40x)             := mktree
35 tools-$(CONFIG_EBONY)           := mktree
36 tools-$(CONFIG_LOPEC)           := mkbugboot mkprep
37 tools-$(CONFIG_MCPN765)         := mkbugboot mkprep
38 tools-$(CONFIG_MENF1)           := mkprep
39 tools-$(CONFIG_MVME5100)        := mkbugboot mkprep
40 tools-$(CONFIG_PRPMC750)        := mkbugboot mkprep
41 tools-$(CONFIG_PRPMC800)        := mkbugboot mkprep
42 tools-$(CONFIG_SPRUCE)          := mktree
43
44 # These are dirs we don't want to go into on BOOT_TARGETS.  We have them for
45 # the 'depend' stage.
46 NONBOOT                         := lib common
47
48 # These are the subdirs we want to use
49 BOOTDIRS                        = $(filter-out $(NONBOOT), $(subdir-y))
50
51 # This will make the tools we need.  We do it like this to ensure that we use
52 # HOSTCC. -- Tom
53 maketools:
54         $(MAKE) -C utils $(tools-y)
55
56 # The targets all boards support for boot images.
57 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
58
59 $(BOOT_TARGETS): vmapus lib/zlib.a images/vmlinux.gz maketools
60 ifneq ($(BOOTDIRS),)
61         for d in $(BOOTDIRS); do $(MAKE) -C $$d $@; done
62 endif
63
64 vmapus: $(TOPDIR)/vmlinux
65 ifdef CONFIG_APUS
66         $(STRIP) $(TOPDIR)/vmlinux -o images/vmapus
67         gzip $(GZIP_FLAGS) images/vmapus
68 endif
69
70 # Make an image for PPCBoot
71 pImage: images/vmlinux.gz
72         $(MKIMAGE) -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
73         -n 'Linux-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)' \
74         -d $< images/vmlinux.PPCBoot
75         ln -sf vmlinux.PPCBoot images/pImage
76         cp -f ./images/vmlinux.PPCBoot /tftpboot/pImage
77
78 vmlinux.sm: $(TOPDIR)/vmlinux utils/addSystemMap
79         ./utils/addSystemMap $(TOPDIR)/System.map $(TOPDIR)/vmlinux images/vmlinux.sm
80
81 # These are subdirs with files not normally rm'ed. -- Tom
82 clean:
83         $(MAKE) -C images clean
84         $(MAKE) -C utils clean
85
86 include $(TOPDIR)/Rules.make