Commit c23e30be authored by Paul Mackerras's avatar Paul Mackerras

PPC32: Makefile cleanups, patch from Sam Ravnborg

parent b85223e9
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
# #
# This must match PAGE_OFFSET in include/asm-ppc/page.h. # This must match PAGE_OFFSET in include/asm-ppc/page.h.
KERNELLOAD =$(CONFIG_KERNEL_START) KERNELLOAD := $(CONFIG_KERNEL_START)
LDFLAGS_BLOB := --format binary --oformat elf32-powerpc LDFLAGS_BLOB := --format binary --oformat elf32-powerpc
LDFLAGS_vmlinux = -Ttext $(KERNELLOAD) -Bstatic LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
CPPFLAGS += -Iarch/$(ARCH) CPPFLAGS += -Iarch/$(ARCH)
AFLAGS += -Iarch/$(ARCH) AFLAGS += -Iarch/$(ARCH)
cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \ cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \
......
...@@ -17,24 +17,13 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd ...@@ -17,24 +17,13 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
bootdir-y := simple bootdir-y := simple
bootdir-$(CONFIG_ALL_PPC) := openfirmware prep bootdir-$(CONFIG_ALL_PPC) := openfirmware prep
subdir-y := lib common images subdir-y := lib/ common/ images/
subdir-$(CONFIG_ALL_PPC) += of1275 subdir-$(CONFIG_ALL_PPC) += of1275/
# for cleaning # for cleaning
subdir- += simple/ openfirmware/ prep/ subdir- += simple/ openfirmware/ prep/
tools-$(CONFIG_ALL_PPC) := addnote mknote hack-coff mkprep host-progs := $(addprefix utils/, addnote mknote hack-coff mkprep mkbugboot mktree)
tools-$(CONFIG_PPLUS) := mkbugboot mkprep
tools-$(CONFIG_4xx) := mktree
tools-$(CONFIG_LOPEC) := mkbugboot mkprep
tools-$(CONFIG_MCPN765) := mkbugboot mkprep
tools-$(CONFIG_MENF1) := mkprep
tools-$(CONFIG_MVME5100) := mkbugboot mkprep
tools-$(CONFIG_PRPMC750) := mkbugboot mkprep
tools-$(CONFIG_PRPMC800) := mkbugboot mkprep
tools-$(CONFIG_SPRUCE) := mktree
host-progs := $(addprefix utils/,$(tools-y))
.PHONY: $(BOOT_TARGETS) $(bootdir-y) .PHONY: $(BOOT_TARGETS) $(bootdir-y)
......
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
# This dir holds all of the images for PPC machines. # This dir holds all of the images for PPC machines.
# Tom Rini January 2001 # Tom Rini January 2001
extra-y := vmlinux.gz extra-y := vmlinux.bin vmlinux.gz
GZIP_FLAGS := -v9f
$(obj)/vmlinux.gz: vmlinux OBJCOPYFLAGS_vmlinux.bin := -O binary
$(OBJCOPY) -O binary $< $(@:.gz=) $(obj)/vmlinux.bin: vmlinux FORCE
gzip $(GZIP_FLAGS) $(@:.gz=) $(call if_changed,objcopy)
$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)
# Files generated that shall be removed upon make clean # Files generated that shall be removed upon make clean
clean-files := sImage vmapus vmlinux* miboot* zImage* clean-files := sImage vmapus vmlinux* miboot* zImage*
...@@ -13,17 +13,11 @@ ...@@ -13,17 +13,11 @@
# modified by Cort (cort@cs.nmt.edu) # modified by Cort (cort@cs.nmt.edu)
# #
boot: zImage TFTPIMAGE := /tftpboot/zImage.prep
TFTPIMAGE = /tftpboot/zImage.prep
ifeq ($(CONFIG_SMP),y) ifeq ($(CONFIG_SMP),y)
TFTPIMAGE = $(TFTPBOOT).smp TFTPIMAGE := $(TFTPBOOT).smp
endif endif
LD_ARGS = -T $(boot)/ld.script -Ttext 0x00800000 -Bstatic
OBJCOPY_ARGS = -O elf32-powerpc
LIBS = $(common)/lib.a $(bootlib)/lib.a
boot-y := head.o misc.o boot-y := head.o misc.o
boot-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o boot-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
...@@ -31,56 +25,70 @@ boot := arch/ppc/boot ...@@ -31,56 +25,70 @@ boot := arch/ppc/boot
common := $(boot)/common common := $(boot)/common
utils := $(boot)/utils utils := $(boot)/utils
bootlib := $(boot)/lib bootlib := $(boot)/lib
of1275 := $(boot)/of1275
images := $(boot)/images images := $(boot)/images
simple := $(boot)/simple simple := $(boot)/simple
EXTRA_TARGETS := $(boot-y) ../simple/legacy.o OBJCOPYFLAGS := -O elf32-powerpc
OBJS := $(addprefix $(obj)/,$(boot-y)) $(simple)/legacy.o LIBS := $(common)/lib.a $(bootlib)/lib.a
# Tools targets := $(boot-y) dummy.o ../simple/legacy.o
MKPREP := $(utils)/mkprep OBJS := $(addprefix $(obj)/,$(boot-y)) $(simple)/legacy.o
# Extra include search dirs # Extra include search dirs
CFLAGS_kbd.o += -Idrivers/char CFLAGS_kbd.o += -Idrivers/char
zImage: initrd :=
zImage: $(images)/zImage.prep zImage: $(images)/zImage.prep
@echo ' kernel: $@ is ready ($<)'
zImage.initrd: initrd := .initrd
zImage.initrd: $(images)/zImage.initrd.prep zImage.initrd: $(images)/zImage.initrd.prep
@echo ' kernel: $@ is ready ($<)'
$(obj)/dummy.o: $(common)/dummy.c mages)/ramdisk.image.gz:
$(CC) -c -o $@ $(common)/dummy.c @echo ' MISSING $@'
@echo ' RAM disk image must be provided separatly'
@/bin/false
$(images)/zImage.prep: $(OBJS) $(LIBS) $(boot)/ld.script $(images)/vmlinux.gz \ OBJCOPYFLAGS_image.o := \
$(obj)/dummy.o $(MKPREP)
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section=.image=$(images)/vmlinux.gz \ --add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data \ --set-section-flags=.image=contents,alloc,load,readonly,data
$(obj)/dummy.o $(obj)/image.o targets += image.o
$(LD) $(LD_ARGS) -o $(obj)/zImage $(OBJS) $(obj)/image.o $(LIBS) $(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz
$(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/zImage $(obj)/zImage \ $(call if_changed,objcopy)
-R .comment -R .stab -R .stabstr
$(MKPREP) -pbp $(obj)/zImage $@ OBJCOPYFLAGS_image.initrd.o := \
rm -f $(obj)/zImage
$(images)/zImage.initrd.prep: $(OBJS) $(LIBS) $(boot)/ld.script \
$(images)/vmlinux.gz $(obj)/dummy.o $(MKPREP)
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section=.ramdisk=$(images)/ramdisk.image.gz \ --add-section=.ramdisk=$(images)/ramdisk.image.gz \
--set-section-flags=.ramdisk=contents,alloc,load,readonly,data \ --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
--add-section=.image=$(images)/vmlinux.gz \ --add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data \ --set-section-flags=.image=contents,alloc,load,readonly,data
$(obj)/dummy.o $(obj)/image.o targets += image.initrd.o
$(LD) $(LD_ARGS) -o $(obj)/zImage.initrd $(OBJS) $(obj)/image.o $(LIBS) $(obj)/image.initrd.o: $(obj)/dummy.o $(images)/vmlinux.gz $(images)/ramdisk.image.gz
$(OBJCOPY) $(OBJCOPY_ARGS) $(obj)/zImage.initrd $(obj)/zImage.initrd \ $(call if_changed,objcopy)
-R .comment -R .stab -R .stabstr
$(MKPREP) -pbp $(obj)/zImage.initrd $@ LDFLAGS_zImage.bin := -Ttext 0x00800000 -Bstatic -T
rm -f $(obj)/zImage.initrd LDFLAGS_zImage.initrd.bin := -Ttext 0x00800000 -Bstatic -T
targets += zImage.bin zImage.initrd.bin
$(obj)/zImage$(initrd).bin: $(boot)/ld.script $(OBJS) $(obj)/image.o $(LIBS)
$(call if_changed,ld)
OBJCOPYFLAGS_zImage := -R .comment -R .stab -R .stabstr
OBJCOPYFLAGS_zImage.initrd := -R .comment -R .stab -R .stabstr
targets += zImage zImage.initrd
$(obj)/zImage$(initrd): %: %.bin FORCE
$(call if_changed,objcopy)
quiet_cmd_mkprep = MKPREP $@
cmd_mkprep = $(utils)/mkprep -pbp $< $@
$(images)/zImage$(initrd).prep: $(obj)/zImage$(initrd) $(utils)/mkprep FORCE
$(call cmd,mkprep)
#
# Convinient shorthands for various targets
#
floppy: zImage floppy: zImage
dd if=$(images)/zImage.prep of=/dev/fd0H1440 bs=64b dd if=$(images)/zImage.prep of=/dev/fd0H1440 bs=64b
znetboot : zImage znetboot.initrd : zImage$(initrd)
cp $(images)/zImage.prep $(TFTPIMAGE) cp $(images)/zImage$(initrd).prep $(TFTPIMAGE)
znetboot.initrd : zImage.initrd
cp $(images)/zImage.initrd.prep $(TFTPIMAGE)
int main(void)
{
return 0;
}
#
# arch/ppc/boot/utils/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
HOSTCFLAGS += -I$(TOPDIR)/arch/$(ARCH)/boot/include
all: FORCE
# Simple programs with 1 file and no extra CFLAGS
UTILS = addnote hack-coff mkprep mknote mkbugboot mktree \
addSystemMap addRamdDisk
$(UTILS):
$(HOSTCC) $(HOSTCFLAGS) -o $@ $@.c
clean:
rm -f $(UTILS)
...@@ -10,12 +10,10 @@ EXTRA_AFLAGS := -Wa,-m405 ...@@ -10,12 +10,10 @@ EXTRA_AFLAGS := -Wa,-m405
endif endif
# Start off with 'head.o', change as needed. # Start off with 'head.o', change as needed.
HEAD-y := head.o extra-y := head.o
HEAD-$(CONFIG_40x) := head_4xx.o extra-$(CONFIG_40x) := head_4xx.o
HEAD-$(CONFIG_8xx) := head_8xx.o extra-$(CONFIG_8xx) := head_8xx.o
HEAD-$(CONFIG_6xx) += idle_6xx.o extra-$(CONFIG_6xx) += idle_6xx.o
extra-y := $(HEAD-y)
obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
process.o signal.o ptrace.o align.o \ process.o signal.o ptrace.o align.o \
......
# #
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now in the main makefile...
#
# NB: cribbed from the drivers/sbus/Makefile -- PMM
obj-y += ocp.o ocp-driver.o ocp-probe.o obj-y := ocp.o ocp-driver.o ocp-probe.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