Makefile (95698570510b7be9ab1542a4a908242c05a9b0ed) Makefile (51f19cfa76d7d20ec767719a427e3d4f450fd5de)
1# Makefile for the Sparc boot stuff.
2#
3# Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
4# Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
5
6ROOT_IMG := /usr/src/root.img
7ELFTOAOUT := elftoaout
8
1# Makefile for the Sparc boot stuff.
2#
3# Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
4# Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
5
6ROOT_IMG := /usr/src/root.img
7ELFTOAOUT := elftoaout
8
9hostprogs-y := piggyback btfixupprep
10targets := tftpboot.img btfix.o btfix.S image zImage vmlinux.aout
9hostprogs-y := piggyback
10targets := tftpboot.img image zImage vmlinux.aout
11clean-files := System.map
12
13quiet_cmd_elftoaout = ELFTOAOUT $@
14 cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@
15quiet_cmd_piggy = PIGGY $@
16 cmd_piggy = $(obj)/piggyback $(BITS) $@ System.map $(ROOT_IMG)
17quiet_cmd_strip = STRIP $@
18 cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $< -o $@
19
11clean-files := System.map
12
13quiet_cmd_elftoaout = ELFTOAOUT $@
14 cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@
15quiet_cmd_piggy = PIGGY $@
16 cmd_piggy = $(obj)/piggyback $(BITS) $@ System.map $(ROOT_IMG)
17quiet_cmd_strip = STRIP $@
18 cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $< -o $@
19
20ifeq ($(CONFIG_SPARC32),y)
21quiet_cmd_btfix = BTFIX $@
22 cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@
23quiet_cmd_sysmap = SYSMAP $(obj)/System.map
24 cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
25quiet_cmd_image = LD $@
26 cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@
27
28define rule_image
29 $(if $($(quiet)cmd_image), \
30 echo ' $($(quiet)cmd_image)' &&) \
31 $(cmd_image); \
32 $(if $($(quiet)cmd_sysmap), \
33 echo ' $($(quiet)cmd_sysmap)' &&) \
34 $(cmd_sysmap) $@ $(obj)/System.map; \
35 if [ $$? -ne 0 ]; then \
36 rm -f $@; \
37 /bin/false; \
38 fi; \
39 echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd
40endef
41
42# Support for kallsyms
43kallsyms-$(CONFIG_KALLSYMS) := .tmp_kallsyms2.o
44ifdef KALLSYMS_EXTRA_PASS
45 kallsyms-$(CONFIG_KALLSYMS) := .tmp_kallsyms3.o
46endif
47
48LDFLAGS_image := -T $(KBUILD_LDS) $(KBUILD_VMLINUX_INIT) \
49 --start-group $(KBUILD_VMLINUX_MAIN) --end-group \
50 $(kallsyms-y) $(obj)/btfix.o
51
52# Link the final image including btfixup'ed symbols.
53# This is a replacement for the link done in the top-level Makefile.
54# Note: No dependency on the prerequisite files since that would require
55# make to try check if they are updated - and due to changes
56# in gcc options (path for example) this would result in
57# these files being recompiled for each build.
58$(obj)/image: $(obj)/btfix.o FORCE
59 $(call if_changed_rule,image)
60
61$(obj)/zImage: $(obj)/image
62 $(call if_changed,strip)
63 @echo ' kernel: $@ is ready'
64
65$(obj)/btfix.S: $(obj)/btfixupprep vmlinux FORCE
66 $(call if_changed,btfix)
67
68endif
69
70ifeq ($(CONFIG_SPARC64),y)
71
72# Actual linking
20ifeq ($(CONFIG_SPARC64),y)
21
22# Actual linking
73$(obj)/image: vmlinux FORCE
74 $(call if_changed,strip)
75 @echo ' kernel: $@ is ready'
76
77$(obj)/zImage: $(obj)/image
78 $(call if_changed,gzip)
79 @echo ' kernel: $@ is ready'
80
81$(obj)/vmlinux.aout: vmlinux FORCE
82 $(call if_changed,elftoaout)
83 @echo ' kernel: $@ is ready'
84else
85
23
24$(obj)/zImage: $(obj)/image
25 $(call if_changed,gzip)
26 @echo ' kernel: $@ is ready'
27
28$(obj)/vmlinux.aout: vmlinux FORCE
29 $(call if_changed,elftoaout)
30 @echo ' kernel: $@ is ready'
31else
32
33$(obj)/zImage: $(obj)/image
34 $(call if_changed,strip)
35 @echo ' kernel: $@ is ready'
36
86# The following lines make a readable image for U-Boot.
87# uImage - Binary file read by U-boot
88# uImage.o - object file of uImage for loading with a
89# flash programmer understanding ELF.
90
91OBJCOPYFLAGS_image.bin := -S -O binary -R .note -R .comment
92$(obj)/image.bin: $(obj)/image FORCE
93 $(call if_changed,objcopy)

--- 12 unchanged lines hidden (view full) ---

106targets += uImage
107$(obj)/uImage: $(obj)/image.gz
108 $(call if_changed,uimage)
109 $(call if_changed,uimage.o)
110 @echo ' Image $@ is ready'
111
112endif
113
37# The following lines make a readable image for U-Boot.
38# uImage - Binary file read by U-boot
39# uImage.o - object file of uImage for loading with a
40# flash programmer understanding ELF.
41
42OBJCOPYFLAGS_image.bin := -S -O binary -R .note -R .comment
43$(obj)/image.bin: $(obj)/image FORCE
44 $(call if_changed,objcopy)

--- 12 unchanged lines hidden (view full) ---

57targets += uImage
58$(obj)/uImage: $(obj)/image.gz
59 $(call if_changed,uimage)
60 $(call if_changed,uimage.o)
61 @echo ' Image $@ is ready'
62
63endif
64
65$(obj)/image: vmlinux FORCE
66 $(call if_changed,strip)
67 @echo ' kernel: $@ is ready'
68
114$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback System.map $(ROOT_IMG) FORCE
115 $(call if_changed,elftoaout)
116 $(call if_changed,piggy)
69$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback System.map $(ROOT_IMG) FORCE
70 $(call if_changed,elftoaout)
71 $(call if_changed,piggy)