Commit 3ce50dce authored by Pete Zaitcev's avatar Pete Zaitcev Committed by David S. Miller

[SPARC]: Add Ravnborg Makefile cleanups.

parent 773b54d7
...@@ -53,27 +53,26 @@ NET_Y := $(patsubst %/, %/built-in.o, $(net-y)) ...@@ -53,27 +53,26 @@ NET_Y := $(patsubst %/, %/built-in.o, $(net-y))
LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y)) LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y))
export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD
image: vmlinux makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/$(ARCH)/boot $(1)
$(MAKE) -C arch/sparc/boot image
image tftpboot.img: vmlinux
$(call makeboot,arch/sparc/boot/$@)
archclean: archclean:
rm -f $(TOPDIR)/vmlinux.aout $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot
-$(MAKE) -C arch/sparc/boot clean
archmrproper: archmrproper:
rm -f $(TOPDIR)/include/asm-sparc/asm_offsets.h
prepare: include/asm-$(ARCH)/asm_offsets.h prepare: include/asm-$(ARCH)/asm_offsets.h
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER include/config/MARKER
include/asm-$(ARCH)/asm_offsets.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
@$(generate-asm-offsets.h) < $< > $@
include/asm-$(ARCH)/asm_offsets.h: include/asm-$(ARCH)/asm_offsets.h.tmp
@echo -n ' Generating $@' @echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed) @$(update-if-changed)
tftpboot.img: CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h.tmp \
$(MAKE) -C arch/sparc/boot tftpboot.img include/asm-$(ARCH)/asm_offsets.h \
arch/$(ARCH)/kernel/asm-offsets.s
...@@ -4,38 +4,35 @@ ...@@ -4,38 +4,35 @@
# Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) # Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
# Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz) # Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
ROOT_IMG =/usr/src/root.img ROOT_IMG := /usr/src/root.img
ELFTOAOUT =elftoaout ELFTOAOUT := elftoaout
all: btfix.o host-progs := piggyback btfixupprep
EXTRA_TARGETS := tftpboot.img btfix.o btfix.s image
tftpboot.img: piggyback quiet_cmd_elftoaout = ELFTOAOUT $@
$(ELFTOAOUT) $(TOPDIR)/vmlinux -o tftpboot.img cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@
./piggyback tftpboot.img $(TOPDIR)/System.map $(ROOT_IMG) quiet_cmd_piggy = PIGGY $@
cmd_piggy = $(obj)/piggyback $@ $(obj)/System.map $(ROOT_IMG)
piggyback: piggyback.c quiet_cmd_btfix = BTFIX $@
$(HOSTCC) $(HOSTCFLAGS) -o piggyback piggyback.c cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@
btfixupprep: btfixupprep.c
$(HOSTCC) $(HOSTCFLAGS) -o btfixupprep btfixupprep.c
clean:
rm -f btfixupprep piggyback tftpboot.img btfix.o btfix.s image
BTOBJS := $(HEAD) $(INIT_Y) BTOBJS := $(HEAD) $(INIT_Y)
BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y)
LDFLAGS_image := -T arch/sparc/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group
# Actual linking # Actual linking
image: btfix.o $(obj)/image: $(obj)/btfix.o FORCE
$(LD) $(LDFLAGS) -T ../vmlinux.lds.s \ $(call if_changed,ld)
$(patsubst %,$(TOPDIR)/%,$(BTOBJS)) \ $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(obj)/System.map
--start-group \
$(patsubst %,$(TOPDIR)/%,$(BTLIBS)) \ $(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE
btfix.o \ $(call if_changed,elftoaout)
--end-group -o image $(call if_changed,piggy)
btfix.s: btfixupprep $(TOPDIR)/vmlinux $(obj)/btfix.s: $(obj)/btfixupprep vmlinux FORCE
$(OBJDUMP) -x $(TOPDIR)/vmlinux | ./btfixupprep > btfix.s $(call if_changed,btfix)
btfix.o: btfix.s archhelp:
$(CC) -c -o btfix.o btfix.s @echo '* image - kernel image ($(obj)/image)'
@echo ' tftpboot.img - image prepared for tftp'
...@@ -2,15 +2,13 @@ ...@@ -2,15 +2,13 @@
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
SH = $(CONFIG_SHELL)
EXTRA_TARGETS := head.o init_task.o EXTRA_TARGETS := head.o init_task.o
EXTRA_AFLAGS := -ansi EXTRA_AFLAGS := -ansi
export-objs := sparc_ksyms.o export-objs := sparc_ksyms.o
IRQ_OBJS := irq.o sun4m_irq.o sun4c_irq.o sun4d_irq.o IRQ_OBJS := irq.o sun4m_irq.o sun4c_irq.o sun4d_irq.o
obj-y := entry.o wof.o wuf.o etrap.o rtrap.o traps.o ${IRQ_OBJS} \ obj-y := entry.o wof.o wuf.o etrap.o rtrap.o traps.o $(IRQ_OBJS) \
process.o signal.o ioport.o setup.o idprom.o \ process.o signal.o ioport.o setup.o idprom.o \
sys_sparc.o sunos_asm.o systbls.o \ sys_sparc.o sunos_asm.o systbls.o \
time.o windows.o cpu.o devices.o sclow.o \ time.o windows.o cpu.o devices.o sclow.o \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment