Commit d9b456a5 authored by Kai Germaschewski's avatar Kai Germaschewski

Merge

parents 0a155168 54066682
No related merge requests found
......@@ -10,7 +10,7 @@ This document describes the Linux kernel Makefiles.
--- 3.1 Goal definitions
--- 3.2 Built-in object goals - obj-y
--- 3.3 Loadable module goals - obj-m
--- 3.4 Objects which export symbols - export-objs
--- 3.4 Objects which export symbols
--- 3.5 Library file goals - L_TARGET
--- 3.6 Descending down in directories
--- 3.7 Compilation flags
......@@ -208,32 +208,11 @@ more details, with real examples.
kbuild will build an ext2.o file for you out of the individual
parts and then link this into built-in.o, as you would expect.
--- 3.4 Objects which export symbols - export-objs
--- 3.4 Objects which export symbols
When using loadable modules, not every global symbol in the
kernel / other modules is automatically available, only those
explicitly exported are available for your module.
To make a symbol available for use in modules, to "export" it,
use the EXPORT_SYMBOL(<symbol>) directive in your source. In
addition, you need to list all object files which export symbols
(i.e. their source contains an EXPORT_SYMBOL() directive) in the
Makefile variable $(export-objs).
Example:
#drivers/isdn/i4l/Makefile
# Objects that export symbols.
export-objs := isdn_common.o
since isdn_common.c contains
EXPORT_SYMBOL(register_isdn);
which makes the function register_isdn available to
low-level ISDN drivers.
There exist a EXPORT_SYMBOL_GPL() variant with similar functionality,
but more restrictive with what may use that symbol. The requirement
to list the .o file in export-objs is the same.
No special notation is required in the makefiles for
modules exporting symbols.
See also Documentation/modules.txt.
--- 3.5 Library file goals - L_TARGET
......@@ -400,7 +379,7 @@ done utilising the variable host-prog.
The second step is to add an explicit dependency to the executable.
This can be done in two ways. Either add the dependency in a rule,
or utilise the variable build-targets.
or utilise the variable $(always).
Both possibilities are described in the following.
--- 4.1 Simple Host Program
......@@ -526,15 +505,15 @@ Both possibilities are described in the following.
$(obj)/gen-devlist is updated. Note that references to
the host programs in special rules must be prefixed with $(obj).
(2) Use $(build-targets)
(2) Use $(always)
When there is no suitable special rule, and the host program
shall be built when a makefile is entered, the $(build-targets)
shall be built when a makefile is entered, the $(always)
variable shall be used.
Example:
#scripts/lxdialog/Makefile
host-progs := lxdialog
build-targets := $(host-progs)
always := $(host-progs)
This will tell kbuild to build lxdialog even if not referenced in
any rule.
......@@ -543,13 +522,13 @@ Both possibilities are described in the following.
"make clean" deletes most generated files in the src tree where the kernel
is compiled. This includes generated files such as host programs.
Kbuild knows targets listed in $(host-progs) and $(EXTRA_TARGETS) and
they are all deleted during "make clean".
Kbuild knows targets listed in $(host-progs), $(always), $(extra-y) and
$(targets). They are all deleted during "make clean".
Files matching the patterns "*.[oas]", "*.ko", plus some additional files
generated by kbuild are deleted all over the kernel src tree when
"make clean" is executed.
Additional files can be specified by means of $(clean-files).
Additional files can be specified in kbuild makefiles by use of $(clean-files).
Example:
#drivers/pci/Makefile
......@@ -818,31 +797,23 @@ When kbuild executes the following steps are followed (roughly):
--- 6.5 Building non-kbuild targets
EXTRA_TARGETS
extra-y
EXTRA_TARGETS specify additional targets created in current
extra-y specify additional targets created in current
directory, in addition to any targets specified by obj-*.
Listing all targets in EXTRA_TARGETS is required for three purposes:
1) Avoid that the target is linked in as part of built-in.o
2) Enable kbuild to check changes in command lines
Listing all targets in extra-y is required for two purposes:
1) Enable kbuild to check changes in command lines
- When $(call if_changed,xxx) is used
3) kbuild knows what file to delete during "make clean"
2) kbuild knows what files to delete during "make clean"
Example:
#arch/i386/kernel/Makefile
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
In this example EXTRA_TARGETS is used to list object files that
In this example extra-y is used to list object files that
shall be built, but shall not be linked as part of built-in.o.
Example:
#arch/i386/boot/Makefile
EXTRA_TARGETS := vmlinux.bin bootsect bootsect.o
In this example EXTRA_TARGETS is used to list all intermediate
targets, and all final targets.
The targets are added to EXTRA_TARGETS to enable 2) and 3) above.
--- 6.6 Commands useful for building a boot image
......@@ -861,9 +832,10 @@ When kbuild executes the following steps are followed (roughly):
needs an update, or the commandline has changed since last
invocation. The latter will force a rebuild if any options
to the executable have changed.
Any target that utilises if_changed must be listed in EXTRA_TARGETS,
Any target that utilises if_changed must be listed in $(targets),
otherwise the command line check will fail, and the target will
always be built.
Assignments to $(targets) are without $(obj)/ prefix.
if_changed may be used in conjunction with custom commands as
defined in 6.7 "Custom kbuild commands".
Note: It is a typical mistake to forget the FORCE prerequisite.
......@@ -874,10 +846,34 @@ When kbuild executes the following steps are followed (roughly):
objcopy
Copy binary. Uses OBJCOPYFLAGS usually specified in
arch/$(ARCH)/Makefile.
OBJCOPYFLAGS_$@ may be used to set additional options.
gzip
Compress target. Use maximum compression to compress target.
Example:
#arch/i386/boot/Makefile
LDFLAGS_bootsect := -Ttext 0x0 -s --oformat binary
LDFLAGS_setup := -Ttext 0x0 -s --oformat binary -e begtext
targets += setup setup.o bootsect bootsect.o
$(obj)/setup $(obj)/bootsect: %: %.o FORCE
$(call if_changed,ld)
In this example there is two possible targets, requiring different
options to the linker. the linker options are specified using the
LDFLAGS_$@ syntax - one for each potential target.
$(targets) are assinged all potential targets, herby kbuild knows
the targets and will:
1) check for commandline changes
2) delete target during make clean
The ": %: %.o" part of the prerequisite is a shorthand that
free us from listing the setup.o and bootsect.o files.
Note: It is a common mistake to forget the "target :=" assignment,
resulting in the target file being recompiled for no
obvious reason.
--- 6.7 Custom kbuild commands
......@@ -894,6 +890,7 @@ When kbuild executes the following steps are followed (roughly):
cmd_image = $(obj)/tools/build $(BUILDFLAGS) \
$(obj)/vmlinux.bin > $@
targets += bzImage
$(obj)/bzImage: $(obj)/vmlinux.bin $(obj)/tools/build FORCE
$(call if_changed,image)
@echo 'Kernel: $@ is ready'
......
......@@ -479,17 +479,19 @@ include/linux/autoconf.h: .config scripts/fixdep
uts_len := 64
include/linux/version.h: Makefile
@if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \
define filechk_version.h
if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \
fi;
@echo -n ' GEN $@'
@(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
) > $@.tmp
@$(update-if-changed)
)
endef
include/linux/version.h: Makefile
$(call filechk,version.h)
# ---------------------------------------------------------------------------
......@@ -558,7 +560,7 @@ endif # CONFIG_MODULES
# Generate asm-offsets.h
# ---------------------------------------------------------------------------
define generate-asm-offsets.h
define filechk_gen-asm-offsets
(set -e; \
echo "#ifndef __ASM_OFFSETS_H__"; \
echo "#define __ASM_OFFSETS_H__"; \
......@@ -574,7 +576,6 @@ define generate-asm-offsets.h
echo "#endif" )
endef
else # ifdef include_config
ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
......@@ -885,13 +886,27 @@ if_changed_rule = $(if $(strip $? \
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
define update-if-changed
if [ -r $@ ] && cmp -s $@ $@.tmp; then \
echo ' (unchanged)'; \
rm -f $@.tmp; \
else \
echo ' (updated)'; \
mv -f $@.tmp $@; \
# filechk is used to check if the content of a generated file is updated.
# Sample usage:
# define filechk_sample
# echo $KERNELRELEASE
# endef
# version.h : Makefile
# $(call filechk,sample)
# The rule defined shall write to stdout the content of the new file.
# The existing file will be compared with the new one.
# - If no file exist it is created
# - If the content differ the new file is used
# - If they are equal no change, and no timestamp update
define filechk
@echo ' CHK $@';
@set -e; $(filechk_$(1)) > $@.tmp
if [ -r $@ ] && cmp -s $@ $@.tmp; then \
rm -f $@.tmp; \
else \
echo ' UPD $@'; \
mv -f $@.tmp $@; \
fi
endef
......
......@@ -119,15 +119,12 @@ arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
$(call filechk,gen-asm-offsets)
archclean:
$(Q)$(MAKE) -f scripts/Makefile.clean obj=$(boot)
CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h.tmp \
include/asm-$(ARCH)/asm_offsets.h
CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
define archhelp
echo '* boot - Compressed kernel image (arch/alpha/boot/vmlinux.gz)'
......
......@@ -9,7 +9,7 @@
#
host-progs := tools/mkbb tools/objstrip
EXTRA_TARGETS := vmlinux.gz vmlinux \
targets := vmlinux.gz vmlinux \
vmlinux.nh tools/lxboot tools/bootlx tools/bootph \
bootloader bootpheader
OBJSTRIP := $(obj)/tools/objstrip
......
......@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
EXTRA_TARGETS := head.o
extra-y := head.o
EXTRA_AFLAGS := $(CFLAGS)
EXTRA_CFLAGS := -Werror -Wno-sign-compare
......
......@@ -211,9 +211,7 @@ arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
$(call filechk,gen-asm-offsets)
define archhelp
echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
......
......@@ -69,7 +69,7 @@ endif
export ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS PARAMS_PHYS
EXTRA_TARGETS := Image zImage bootpImage
targets := Image zImage bootpImage
$(obj)/Image: vmlinux FORCE
$(call if_changed,objcopy)
......@@ -106,5 +106,4 @@ zinstall: $(obj)/zImage
$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) \
$(obj)/zImage System.map "$(INSTALL_PATH)"
clean-files := $(addprefix $(obj)/,Image zImage bootpImage)
subdir- := bootp compressed
......@@ -7,7 +7,7 @@ ZLDFLAGS =-p -X -T $(obj)/bootp.lds \
--defsym initrd_addr=$(INITRD_PHYS) \
--defsym params=$(PARAMS_PHYS)
EXTRA_TARGETS := bootp
extra-y := bootp
# Note that bootp.lds picks up kernel.o and initrd.o
$(obj)/bootp: $(addprefix $(obj)/,init.o kernel.o initrd.o bootp.lds)
......
......@@ -65,8 +65,8 @@ endif
SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/LOAD_ADDR/$(ZRELADDR)/;s/BSS_START/$(ZBSSADDR)/
EXTRA_TARGETS := vmlinux vmlinux.lds piggy piggy.gz\
piggy.o font.o head.o $(OBJS)
targets := vmlinux vmlinux.lds piggy piggy.gz piggy.o \
font.o head.o $(OBJS)
EXTRA_CFLAGS := $(CFLAGS_BOOT) -fpic
EXTRA_AFLAGS := -traditional
......@@ -95,7 +95,5 @@ $(obj)/font.o: $(FONTC)
$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in Makefile arch/arm/boot/Makefile .config
@sed "$(SEDFLAGS)" < $< > $@
clean-files := $(addprefix $(obj)/,vmlinux piggy* vmlinux.lds)
$(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c
......@@ -11,9 +11,6 @@ AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR)
obj-y := arch.o compat.o dma.o $(ENTRY_OBJ) entry-common.o irq.o \
process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \
time.o traps.o
obj-m :=
obj-n :=
obj- :=
obj-$(CONFIG_APM) += apm.o
obj-$(CONFIG_PM) += pm.o
......@@ -35,7 +32,7 @@ head-y := head.o
obj-$(CONFIG_DEBUG_LL) += debug.o
endif
EXTRA_TARGETS := $(head-y) init_task.o
extra-y := $(head-y) init_task.o
# Spell out some dependencies that `make dep' doesn't spot
$(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h
......
......@@ -6,12 +6,9 @@
obj-y := arch.o dma.o fault.o irq.o mm.o oldlatches.o \
small_page.o
obj-m :=
obj-n :=
obj- :=
obj-$(CONFIG_DEBUG_LL) += debug.o
EXTRA_TARGETS := head.o
extra-y := head.o
AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR)
......@@ -3,7 +3,7 @@
# Makefile for the linux kernel.
#
EXTRA_TARGETS := head.o
extra-y := head.o
obj-y := process.o signal.o entry.o traps.o irq.o \
ptrace.o setup.o time.o sys_cris.o shadows.o \
......
......@@ -25,9 +25,8 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
#RAMDISK := -DRAMDISK=512
EXTRA_TARGETS := vmlinux.bin bootsect bootsect.o \
setup setup.o zImage bzImage
targets := vmlinux.bin bootsect bootsect.o setup setup.o \
zImage bzImage
subdir- := compressed
host-progs := tools/build
......
......@@ -4,7 +4,7 @@
# create a compressed vmlinux image from the original vmlinux
#
EXTRA_TARGETS := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
EXTRA_AFLAGS := -traditional
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32
......
......@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \
ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
......
......@@ -8,16 +8,14 @@
# Copyright (C) 1998 by David Mosberger-Tang <davidm@hpl.hp.com>
#
EXTRA_TARGETS := vmlinux.bin vmlinux.gz
targets-$(CONFIG_IA64_HP_SIM) += bootloader
targets-$(CONFIG_IA64_GENERIC) += bootloader
EXTRA_TARGETS += $(sort $(targets-y))
targets := vmlinux.bin vmlinux.gz $(targets-y)
quiet_cmd_cptotop = LN $@
cmd_cptotop = ln -f $< $@
vmlinux.gz: $(obj)/vmlinux.gz $(targets-y)
vmlinux.gz: $(obj)/vmlinux.gz $(addprefix $(obj)/,$(targets-y))
$(call cmd,cptotop)
@echo ' Kernel: $@ is ready'
......
......@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o \
irq.o irq_ia64.o irq_lsapic.o ivt.o \
......
......@@ -3,9 +3,9 @@
#
ifndef CONFIG_SUN3
EXTRA_TARGETS := head.o
extra-y := head.o
else
EXTRA_TARGETS := sun3-head.o
extra-y := sun3-head.o
endif
obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \
......
......@@ -86,8 +86,7 @@ LDFLAGS_BLOB := --format binary --oformat elf32-m68k
head-y := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o
CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h.tmp \
include/asm-$(ARCH)/asm-offsets.h \
CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h \
arch/$(ARCH)/kernel/asm-offsets.s
core-y += arch/m68knommu/kernel/ \
......@@ -104,6 +103,4 @@ archclean:
include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
include/asm include/linux/version.h \
include/config/MARKER
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
$(call filechk,gen-asm-offsets)
......@@ -18,4 +18,4 @@ endif
obj-y := config.o
EXTRA_TARGETS := $(BOARD)/crt0_$(MODEL).o
extra-y := $(BOARD)/crt0_$(MODEL).o
......@@ -18,4 +18,4 @@ endif
obj-y := config.o
EXTRA_TARGETS := $(BOARD)/crt0_$(MODEL).o
extra-y := $(BOARD)/crt0_$(MODEL).o
......@@ -18,4 +18,4 @@ endif
obj-y := config.o
EXTRA_TARGETS := $(BOARD)/crt0_$(MODEL).o
extra-y := $(BOARD)/crt0_$(MODEL).o
......@@ -18,4 +18,4 @@ endif
obj-y := config.o
EXTRA_TARGETS := $(BOARD)/crt0_$(MODEL).o
extra-y := $(BOARD)/crt0_$(MODEL).o
......@@ -20,5 +20,5 @@ obj-$(CONFIG_COLDFIRE) += entry.o timers.o vectors.o
obj-$(CONFIG_M5307) += config.o
ifeq ($(CONFIG_M5307),y)
EXTRA_TARGETS := $(BOARD)/crt0_$(MODEL).o
extra-y := $(BOARD)/crt0_$(MODEL).o
endif
......@@ -18,4 +18,4 @@ endif
obj-y := config.o
EXTRA_TARGETS := $(BOARD)/crt0_$(MODEL).o
extra-y := $(BOARD)/crt0_$(MODEL).o
......@@ -7,7 +7,7 @@ obj-$(CONFIG_M68EZ328) += entry.o ints.o
obj-$(CONFIG_M68VZ328) += entry.o ints.o
ifeq ($(CONFIG_M68328),y)
EXTRA_TARGETS := $(BOARD)/bootlogo.rh $(BOARD)/crt0_$(MODEL).o
extra-y := $(BOARD)/bootlogo.rh $(BOARD)/crt0_$(MODEL).o
endif
$(obj)/$(BOARD)/bootlogo.rh: $(src)/bootlogo.h
......
......@@ -4,4 +4,4 @@
obj-y := config.o commproc.o entry.o ints.o
EXTRA_TARGETS := $(BOARD)/crt0_$(MODEL).o
extra-y := $(BOARD)/crt0_$(MODEL).o
......@@ -4,7 +4,7 @@
obj-y := config.o
EXTRA_TARGETS := $(BOARD)/bootlogo.rh $(BOARD)/crt0_$(MODEL).o
extra-y := $(BOARD)/bootlogo.rh $(BOARD)/crt0_$(MODEL).o
$(obj)/$(BOARD)/bootlogo.rh: $(src)/bootlogo.h
perl $(src)/../68328/bootlogo.pl < $(src)/bootlogo.h \
......
......@@ -4,7 +4,7 @@
# EXTRA_AFLAGS = -mips3 -mcpu=r4000 # not used?
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
obj-y += branch.o process.o signal.o entry.o \
traps.o ptrace.o vm86.o ioport.o reset.o \
semaphore.o setup.o syscall.o sysmips.o \
......
......@@ -2,7 +2,7 @@
# Makefile for the Linux/MIPS kernel.
#
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
obj-y := branch.o entry.o proc.o process.o ptrace.o r4k_cache.o r4k_fpu.o \
r4k_genex.o r4k_switch.o r4k_tlb.o r4k_tlb_debug.o r4k_tlb_glue.o \
......
......@@ -3,7 +3,7 @@
# under Linux.
#
EXTRA_TARGETS := ip32-irq-glue.o
extra-y := ip32-irq-glue.o
obj-y += ip32-irq.o ip32-rtc.o ip32-setup.o ip32-irq-glue.o \
ip32-berr.o ip32-timer.o crime.o
......
......@@ -91,12 +91,9 @@ arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.s
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
$(call filechk,gen-asm-offsets)
CLEAN_FILES += palo.conf lifimage include/asm-parisc/offsets.h \
include/asm-parisc/offsets.h.tmp
CLEAN_FILES += palo.conf lifimage include/asm-parisc/offsets.h
define archhelp
@echo '* vmlinux - Uncompressed kernel image (./vmlinux)'
......
......@@ -4,7 +4,8 @@
head-y := head.o
head-$(CONFIG_PARISC64) := head64.o
EXTRA_TARGETS := init_task.o pdc_cons.o process.o unaligned.o $(head-y)
extra-y := init_task.o pdc_cons.o process.o
unaligned.o $(head-y)
AFLAGS_entry.o := -traditional
AFLAGS_pacache.o := -traditional
......
......@@ -80,12 +80,8 @@ prepare: include/asm-$(ARCH)/offsets.h checkbin
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/offsets.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
@$(generate-asm-offsets.h) < $< > $@
include/asm-$(ARCH)/offsets.h: include/asm-$(ARCH)/offsets.h.tmp
@echo -n ' Generating $@'
@$(update-if-changed)
include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
$(call filechk,gen-asm-offsets)
ifdef CONFIG_6xx
# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later
......@@ -106,6 +102,5 @@ checkbin:
@true
endif
CLEAN_FILES += include/asm-$(ARCH)/offsets.h.tmp \
include/asm-$(ARCH)/offsets.h \
CLEAN_FILES += include/asm-$(ARCH)/offsets.h \
arch/$(ARCH)/kernel/asm-offsets.s
......@@ -2,9 +2,8 @@
# This dir holds all of the images for PPC machines.
# Tom Rini January 2001
EXTRA_TARGETS := vmlinux.gz
GZIP_FLAGS = -v9f
targets := vmlinux.gz
GZIP_FLAGS := -v9f
$(obj)/vmlinux.gz: vmlinux
$(OBJCOPY) -O binary $< $(@:.gz=)
......
......@@ -15,7 +15,7 @@ HEAD-$(CONFIG_40x) := head_4xx.o
HEAD-$(CONFIG_8xx) := head_8xx.o
HEAD-$(CONFIG_6xx) += idle_6xx.o
EXTRA_TARGETS := $(HEAD-y)
extra-y := $(HEAD-y)
obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
process.o signal.o ptrace.o align.o \
......
......@@ -51,10 +51,6 @@ arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
CLEAN_FILES += include/asm-ppc64/offsets.h.tmp \
include/asm-ppc64/offsets.h
$(call filechk,gen-asm-offsets)
CLEAN_FILES += include/asm-ppc64/offsets.h
......@@ -59,12 +59,12 @@ src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section)))
gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section)))
host-progs := piggy addnote addSystemMap addRamDisk
EXTRA_TARGETS += zImage zImage.initrd imagesize.c \
targets += zImage zImage.initrd imagesize.c \
$(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
$(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
$(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \
vmlinux.sm vmlinux.initrd vmlinux.sminitrd \
sysmap.o initrd.o
vmlinux.sm vmlinux.initrd vmlinux.sminitrd
extra-y := sysmap.o initrd.o
quiet_cmd_sysmap = SYSMAP $@
cmd_sysmap = $(obj)/addSystemMap System.map $< $@
......
......@@ -3,7 +3,7 @@
#
EXTRA_CFLAGS += -mno-minimal-toc
EXTRA_TARGETS := head.o
extra-y := head.o
obj-y := setup.o entry.o traps.o irq.o idle.o \
time.o process.o signal.o syscalls.o misc.o ptrace.o \
align.o semaphore.o bitops.o stab.o htab.o pacaData.o \
......
......@@ -48,9 +48,6 @@ arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
$(call filechk,gen-asm-offsets)
CLEAN_FILES += include/asm-$(ARCH)/offsets.h.tmp \
include/asm-$(ARCH)/offsets.h
CLEAN_FILES += include/asm-$(ARCH)/offsets.h
......@@ -2,8 +2,8 @@
# Makefile for the linux s390-specific parts of the memory manager.
#
EXTRA_TARGETS := image listing
EXTRA_AFLAGS := -traditional
targets := image listing
EXTRA_AFLAGS := -traditional
quiet_cmd_listing = OBJDUMP $@
cmd_listing = $(OBJDUMP) --disassemble --disassemble-all \
--disassemble-zeroes --reloc vmlinux > $@
......
......@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
EXTRA_AFLAGS := -traditional
obj-y := entry.o bitmap.o traps.o time.o process.o \
......
......@@ -48,9 +48,6 @@ arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
$(call filechk,gen-asm-offsets)
CLEAN_FILES += include/asm-$(ARCH)/offsets.h.tmp \
include/asm-$(ARCH)/offsets.h
CLEAN_FILES += include/asm-$(ARCH)/offsets.h
......@@ -2,8 +2,8 @@
# Makefile for the linux s390-specific parts of the memory manager.
#
EXTRA_TARGETS := image listing
EXTRA_AFLAGS := -traditional
targets := image listing
EXTRA_AFLAGS := -traditional
quiet_cmd_listing = OBJDUMP $@
cmd_listing = $(OBJDUMP) --disassemble --disassemble-all \
......
......@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
EXTRA_AFLAGS := -traditional
obj-y := entry.o bitmap.o traps.o time.o process.o \
......
......@@ -2,7 +2,7 @@
# Makefile for the Linux/SuperH kernel.
#
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
obj-y := process.o signal.o entry.o traps.o irq.o irq_ipr.o \
ptrace.o setup.o time.o sys_sh.o semaphore.o \
......
......@@ -68,10 +68,7 @@ arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
$(call filechk,gen-asm-offsets)
CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h.tmp \
include/asm-$(ARCH)/asm_offsets.h \
CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \
arch/$(ARCH)/kernel/asm-offsets.s
......@@ -8,7 +8,7 @@ ROOT_IMG := /usr/src/root.img
ELFTOAOUT := elftoaout
host-progs := piggyback btfixupprep
EXTRA_TARGETS := tftpboot.img btfix.o btfix.s image
targets := tftpboot.img btfix.o btfix.s image
quiet_cmd_elftoaout = ELFTOAOUT $@
cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@
......
......@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
EXTRA_AFLAGS := -ansi
......
......@@ -7,8 +7,8 @@
ROOT_IMG := /usr/src/root.img
ELFTOAOUT := elftoaout
host-progs := piggyback
EXTRA_TARGETS := tftpboot.img vmlinux.aout
host-progs := piggyback
targets := tftpboot.img vmlinux.aout
quiet_cmd_elftoaout = ELT2AOUT $@
cmd_elftoaout = $(ELFTOAOUT) vmlinux -o $@
......
......@@ -5,7 +5,7 @@
EXTRA_AFLAGS := -ansi
EXTRA_CFLAGS := -Werror
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
obj-y := process.o setup.o cpu.o idprom.o \
traps.o devices.o auxio.o \
......
......@@ -3,7 +3,7 @@
# Licensed under the GPL
#
EXTRA_TARGETS := unmap_fin.o
extra-y := unmap_fin.o
obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \
syscall_kern.o syscall_user.o time.o tlb.o tracer.o trap_user.o \
......
EXTRA_TARGETS := mk_sc mk_thread mk_thread_kern.o
host-progs := mk_sc
always := $(host-progs) mk_thread
targets := mk_thread_kern.o mk_thread_user.o
mk_sc-objs := mk_sc.o
......@@ -11,6 +12,6 @@ $(obj)/mk_thread_user.o : $(src)/mk_thread_user.c
$(CC) $(USER_CFLAGS) -c -o $@ $<
clean :
$(RM) -f $(EXTRA_TARGETS)
$(RM) -f $(build-targets)
archmrproper : clean
EXTRA_TARGETS := mk_task mk_constants
always := mk_task mk_constants
targets := mk_task_user.o mk_task_kern.o \
mk_constants_user.o mk_constants_kern.o
$(obj)/mk_task: $(obj)/mk_task_user.o $(obj)/mk_task_kern.o
$(CC) -o $@ $^
......@@ -16,6 +18,6 @@ $(obj)/mk_constants_kern.o : $(src)/mk_constants_kern.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) $(EXTRA_TARGETS)
$(RM) $(build-targets)
archmrproper:
......@@ -55,14 +55,10 @@ prepare: include/asm-$(ARCH)/asm-consts.h
# Generate constants from C code for use by asm files
arch/$(ARCH)/kernel/asm-consts.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/asm-consts.h.tmp: arch/$(ARCH)/kernel/asm-consts.s
@$(generate-asm-offsets.h) < $< > $@
include/asm-$(ARCH)/asm-consts.h: include/asm-$(ARCH)/asm-consts.h.tmp
@echo -n ' Generating $@'
@$(update-if-changed)
include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.s
$(call filechk,gen-asm-offsets)
CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h.tmp \
include/asm-$(ARCH)/asm-consts.h \
CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h \
arch/$(ARCH)/kernel/asm-consts.s \
root_fs_image.o
......@@ -9,7 +9,7 @@
# for more details.
#
EXTRA_TARGETS := head.o init_task.o
extra-y := head.o init_task.o
obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \
signal.o irq.o mach.o ptrace.o bug.o
......
......@@ -86,15 +86,10 @@ prepare: include/asm-$(ARCH)/offset.h
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/offset.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.s
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
$(call filechk,gen-asm-offsets)
CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \
include/asm-$(ARCH)/offset.h
CLEAN_FILES += include/asm-$(ARCH)/offset.h
define archhelp
echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
......
......@@ -25,8 +25,8 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
#RAMDISK := -DRAMDISK=512
EXTRA_TARGETS := vmlinux.bin bootsect bootsect.o \
setup setup.o bzImage
targets := vmlinux.bin bootsect bootsect.o \
setup setup.o bzImage mtools.conf
EXTRA_CFLAGS := -m32
......
......@@ -6,7 +6,7 @@
# Note all the files here are compiled/linked as 32bit executables.
#
EXTRA_TARGETS := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
EXTRA_AFLAGS := -traditional -m32
# cannot use EXTRA_CFLAGS because base CFLAGS contains -mkernel which conflicts with
......
......@@ -2,8 +2,8 @@
# Makefile for the linux kernel.
#
EXTRA_TARGETS := head.o head64.o init_task.o
EXTRA_AFLAGS := -traditional
extra-y := head.o head64.o init_task.o
EXTRA_AFLAGS := -traditional
obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
pci-dma.o x8664_ksyms.o i387.o syscall.o vsyscall.o \
......
......@@ -21,5 +21,5 @@ $(obj)/version.o: include/linux/compile.h
# actual file if its content has changed.
include/linux/compile.h: FORCE
@echo -n ' GEN $@'
@echo ' CHK $@'
@sh $(srctree)/scripts/mkcompile_h $@ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
......@@ -8,11 +8,11 @@
# docproc: Preprocess .tmpl file in order to generate .sgml docs
# conmakehash: Create arrays for initializing the kernel console tables
host-progs := fixdep split-include conmakehash docproc kallsyms modpost \
mk_elfconfig
build-targets := $(host-progs) empty.o
host-progs := fixdep split-include conmakehash docproc kallsyms modpost \
mk_elfconfig
always := $(host-progs) empty.o
modpost-objs := modpost.o file2alias.o
modpost-objs := modpost.o file2alias.o
subdir-$(CONFIG_MODVERSIONS) += genksyms
......@@ -20,7 +20,7 @@ subdir-$(CONFIG_MODVERSIONS) += genksyms
subdir- += lxdialog kconfig
# fixdep is needed to compile other host programs
$(addprefix $(obj)/,$(filter-out fixdep,$(build-targets)) $(subdir-y)): $(obj)/fixdep
$(addprefix $(obj)/,$(filter-out fixdep,$(always)) $(subdir-y)): $(obj)/fixdep
# dependencies on generated files need to be listed explicitly
......@@ -32,4 +32,4 @@ quiet_cmd_elfconfig = MKELF $@
$(obj)/elfconfig.h: $(obj)/empty.o $(obj)/mk_elfconfig FORCE
$(call if_changed,elfconfig)
targets += $(obj)/elfconfig.h
targets += elfconfig.h
......@@ -15,6 +15,14 @@ include $(obj)/Makefile
include scripts/Makefile.lib
ifdef EXTRA_TARGETS
$(warning kbuild: $(obj)/Makefile - Usage of EXTRA_TARGETS is obsolete in 2.5. Please fix!)
endif
ifdef build-targets
$(warning kbuild: $(obj)/Makefile - Usage of build-targets is obsolete in 2.5. Please fix!)
endif
ifdef export-objs
$(warning kbuild: $(obj)/Makefile - Usage of export-objs is obsolete in 2.5. Please fix!)
endif
......@@ -53,9 +61,9 @@ endif
touch-module = @echo $(@:.o=.ko) > $(MODVERDIR)/$(@F:.o=.mod)
__build: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \
__build: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(extra-y)) \
$(if $(KBUILD_MODULES),$(obj-m)) \
$(subdir-ym) $(build-targets)
$(subdir-ym) $(always)
@:
# Module versioning
......@@ -198,8 +206,7 @@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
%.o: %.S FORCE
$(call if_changed_dep,as_o_S)
targets += $(real-objs-y) $(real-objs-m) $(EXTRA_TARGETS) $(MAKECMDGOALS) \
$(build-targets)
targets += $(real-objs-y) $(real-objs-m) $(extra-y) $(MAKECMDGOALS) $(always)
# Build the compiled-in targets
# ---------------------------------------------------------------------------
......
......@@ -28,15 +28,13 @@ subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-))
# Add subdir path
EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS))
clean-files := $(addprefix $(obj)/,$(clean-files))
host-progs := $(addprefix $(obj)/,$(host-progs))
subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
__clean-files := $(wildcard $(addprefix $(obj)/, \
$(extra-y) $(EXTRA_TARGETS) $(always) $(host-progs) \
$(targets) $(clean-files)))
# ==========================================================================
__clean-files := $(wildcard $(EXTRA_TARGETS) $(host-progs) $(clean-files) $(targets))
quiet_cmd_clean = CLEAN $(obj)
cmd_clean = rm -f $(__clean-files); $(clean-rule)
......
......@@ -8,6 +8,8 @@ comma := ,
empty :=
space := $(empty) $(empty)
# Backward compatibility - to be removed...
extra-y += $(EXTRA_TARGETS)
# Figure out what we need to build from the various variables
# ===========================================================================
......@@ -51,7 +53,7 @@ multi-objs := $(multi-objs-y) $(multi-objs-m)
subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o)))
# Replace multi-part objects by their individual parts, look at local dir only
real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(EXTRA_TARGETS)
real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y)
real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
# C code
......@@ -84,8 +86,9 @@ host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
# Add subdir path
EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS))
build-targets := $(addprefix $(obj)/,$(build-targets))
extra-y := $(addprefix $(obj)/,$(extra-y))
always := $(addprefix $(obj)/,$(always))
targets := $(addprefix $(obj)/,$(targets))
obj-y := $(addprefix $(obj)/,$(obj-y))
obj-m := $(addprefix $(obj)/,$(obj-m))
subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y))
......
host-progs := genksyms
build-targets := $(host-progs)
always := $(host-progs)
genksyms-objs := genksyms.o parse.o lex.o
......
......@@ -15,8 +15,8 @@ endif
endif
endif
host-progs := lxdialog
build-targets := $(host-progs)
host-progs := lxdialog
always := $(host-progs)
lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \
util.o lxdialog.o msgbox.o
......
......@@ -10,7 +10,7 @@ CC=$4
# do "compiled by root"
if [ -r $TARGET -a ! -O include/linux/autoconf.h ]; then
echo ' (not modified)'
echo " SKIPPED $TARGET"
exit 0
fi
......@@ -70,10 +70,9 @@ if [ -r $TARGET ] && \
grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 && \
grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 && \
cmp -s .tmpver.1 .tmpver.2; then
echo ' (unchanged)'
rm -f .tmpcompile
else
echo ' (updated)'
echo " UPD $TARGET"
mv -f .tmpcompile $TARGET
fi
#rm -f .tmpver.1 .tmpver.2
rm -f .tmpver.1 .tmpver.2
......@@ -25,10 +25,10 @@ quiet_cmd_cpio = CPIO $@
$(obj)/initramfs_data.cpio: $(obj)/gen_init_cpio $(initramfs-y) FORCE
$(call if_changed,cpio)
targets += $(obj)/initramfs_data.cpio
targets += initramfs_data.cpio
$(obj)/initramfs_data.cpio.gz: $(obj)/initramfs_data.cpio FORCE
$(call if_changed,gzip)
targets += $(obj)/initramfs_data.cpio.gz
targets += initramfs_data.cpio.gz
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