Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Sep 9, 2005
2 parents 9c8550e + f64a227 commit 486a153
Show file tree
Hide file tree
Showing 171 changed files with 247 additions and 386 deletions.
48 changes: 48 additions & 0 deletions Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Kbuild for top-level directory of the kernel
# This file takes care of the following:
# 1) Generate asm-offsets.h

#####
# 1) Generate asm-offsets.h
#

offsets-file := include/asm-$(ARCH)/asm-offsets.h

always := $(offsets-file)
targets := $(offsets-file)
targets += arch/$(ARCH)/kernel/asm-offsets.s

# Default sed regexp - multiline due to syntax constraints
define sed-y
"/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
endef
# Override default regexp for specific architectures
sed-$(CONFIG_MIPS) := "/^@@@/s///p"

quiet_cmd_offsets = GEN $@
define cmd_offsets
cat $< | \
(set -e; \
echo "#ifndef __ASM_OFFSETS_H__"; \
echo "#define __ASM_OFFSETS_H__"; \
echo "/*"; \
echo " * DO NOT MODIFY."; \
echo " *"; \
echo " * This file was generated by $(srctree)/Kbuild"; \
echo " *"; \
echo " */"; \
echo ""; \
sed -ne $(sed-y); \
echo ""; \
echo "#endif" ) > $@
endef

# We use internal kbuild rules to avoid the "is up to date" message from make
arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
$(Q)mkdir -p $(dir $@)
$(call if_changed_dep,cc_s_c)

$(srctree)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
$(call cmd,offsets)

39 changes: 11 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -776,14 +776,14 @@ $(vmlinux-dirs): prepare-all scripts
# A multi level approach is used. prepare1 is updated first, then prepare0.
# prepare-all is the collection point for the prepare targets.

.PHONY: prepare-all prepare prepare0 prepare1 prepare2
.PHONY: prepare-all prepare prepare0 prepare1 prepare2 prepare3

# prepare2 is used to check if we are building in a separate output directory,
# prepare3 is used to check if we are building in a separate output directory,
# and if so do:
# 1) Check that make has not been executed in the kernel src $(srctree)
# 2) Create the include2 directory, used for the second asm symlink

prepare2:
prepare3:
ifneq ($(KBUILD_SRC),)
@echo ' Using $(srctree) as source for kernel'
$(Q)if [ -f $(srctree)/.config ]; then \
Expand All @@ -795,18 +795,21 @@ ifneq ($(KBUILD_SRC),)
$(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm
endif

# prepare1 creates a makefile if using a separate output directory
prepare1: prepare2 outputmakefile
# prepare2 creates a makefile if using a separate output directory
prepare2: prepare3 outputmakefile

prepare0: prepare1 include/linux/version.h include/asm \
prepare1: prepare2 include/linux/version.h include/asm \
include/config/MARKER
ifneq ($(KBUILD_MODULES),)
$(Q)rm -rf $(MODVERDIR)
$(Q)mkdir -p $(MODVERDIR)
endif

prepare0: prepare prepare1 FORCE
$(Q)$(MAKE) $(build)=$(srctree)

# All the preparing..
prepare-all: prepare0 prepare
prepare-all: prepare0

# Leave this as default for preprocessing vmlinux.lds.S, which is now
# done in arch/$(ARCH)/kernel/Makefile
Expand Down Expand Up @@ -949,26 +952,6 @@ modules modules_install: FORCE

endif # CONFIG_MODULES

# Generate asm-offsets.h
# ---------------------------------------------------------------------------

define filechk_gen-asm-offsets
(set -e; \
echo "#ifndef __ASM_OFFSETS_H__"; \
echo "#define __ASM_OFFSETS_H__"; \
echo "/*"; \
echo " * DO NOT MODIFY."; \
echo " *"; \
echo " * This file was generated by arch/$(ARCH)/Makefile"; \
echo " *"; \
echo " */"; \
echo ""; \
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
echo ""; \
echo "#endif" )
endef


###
# Cleaning is done on three levels.
# make clean Delete most generated files
Expand All @@ -991,7 +974,7 @@ MRPROPER_FILES += .config .config.old include/asm .version \
#
clean: rm-dirs := $(CLEAN_DIRS)
clean: rm-files := $(CLEAN_FILES)
clean-dirs := $(addprefix _clean_,$(vmlinux-alldirs))
clean-dirs := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs))

.PHONY: $(clean-dirs) clean archclean
$(clean-dirs):
Expand Down
11 changes: 0 additions & 11 deletions arch/alpha/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,9 @@ $(boot)/vmlinux.gz: vmlinux
bootimage bootpfile bootpzfile: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@


prepare: include/asm-$(ARCH)/asm_offsets.h

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
$(call filechk,gen-asm-offsets)

archclean:
$(Q)$(MAKE) $(clean)=$(boot)

CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h

define archhelp
echo '* boot - Compressed kernel image (arch/alpha/boot/vmlinux.gz)'
echo ' bootimage - SRM bootable image (arch/alpha/boot/bootimage)'
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include <linux/config.h>
#include <asm/asm_offsets.h>
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
#include <asm/pal.h>
#include <asm/errno.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <linux/config.h>
#include <asm/system.h>
#include <asm/asm_offsets.h>
#include <asm/asm-offsets.h>

.globl swapper_pg_dir
.globl _stext
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/lib/dbg_stackcheck.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Verify that we have not overflowed the stack. Oops if we have.
*/

#include <asm/asm_offsets.h>
#include <asm/asm-offsets.h>

.text
.set noat
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/lib/dbg_stackkill.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* uninitialized local variables in the act.
*/

#include <asm/asm_offsets.h>
#include <asm/asm-offsets.h>

.text
.set noat
Expand Down
9 changes: 2 additions & 7 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ endif
prepare: maketools include/asm-arm/.arch

.PHONY: maketools FORCE
maketools: include/asm-arm/constants.h include/linux/version.h FORCE
maketools: include/linux/version.h FORCE
$(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h

# Convert bzImage to zImage
Expand All @@ -190,7 +190,7 @@ zImage Image xipImage bootpImage uImage: vmlinux
zinstall install: vmlinux
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@

CLEAN_FILES += include/asm-arm/constants.h* include/asm-arm/mach-types.h \
CLEAN_FILES += include/asm-arm/mach-types.h \
include/asm-arm/arch include/asm-arm/.arch

# We use MRPROPER_FILES and CLEAN_FILES now
Expand All @@ -201,11 +201,6 @@ archclean:
bp:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/bootpImage
i zi:; $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@

arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/asm-arm/.arch

include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s
$(call filechk,gen-asm-offsets)

define archhelp
echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/entry-header.S
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <linux/linkage.h>

#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/errno.h>
#include <asm/thread_info.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <asm/mach-types.h>
#include <asm/procinfo.h>
#include <asm/ptrace.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
#include <asm/system.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/iwmmxt.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <linux/linkage.h>
#include <asm/ptrace.h>
#include <asm/thread_info.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>

#define MMX_WR0 (0x00)
#define MMX_WR1 (0x08)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/lib/copy_page.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>

#define COPY_COUNT (PAGE_SZ/64 PLD( -1 ))

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/lib/csumpartialcopyuser.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/errno.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>

.text

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/lib/getuser.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Note that ADDR_LIMIT is either 0 or 0xc0000000.
* Note also that it is intended that __get_user_bad is not global.
*/
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
#include <asm/errno.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/lib/putuser.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Note that ADDR_LIMIT is either 0 or 0xc0000000
* Note also that it is intended that __put_user_bad is not global.
*/
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
#include <asm/errno.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/copypage-v3.S
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>

.text
.align 5
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/copypage-v4wb.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>

.text
.align 5
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/copypage-v4wt.S
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>

.text
.align 5
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-arm1020.S
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <linux/config.h>
#include <linux/init.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/pgtable.h>
#include <asm/procinfo.h>
#include <asm/ptrace.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-arm1020e.S
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <linux/config.h>
#include <linux/init.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/pgtable.h>
#include <asm/procinfo.h>
#include <asm/ptrace.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-arm1022.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <linux/config.h>
#include <linux/init.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/pgtable.h>
#include <asm/procinfo.h>
#include <asm/ptrace.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-arm1026.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <linux/config.h>
#include <linux/init.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/pgtable.h>
#include <asm/procinfo.h>
#include <asm/ptrace.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-arm6_7.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/pgtable.h>
#include <asm/procinfo.h>
#include <asm/ptrace.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-arm720.S
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/pgtable.h>
#include <asm/procinfo.h>
#include <asm/ptrace.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-macros.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* VMA_VM_FLAGS
* VM_EXEC
*/
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-sa110.S
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/procinfo.h>
#include <asm/hardware.h>
#include <asm/pgtable.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-sa1100.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/procinfo.h>
#include <asm/hardware.h>
#include <asm/pgtable.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-v6.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/constants.h>
#include <asm/asm-offsets.h>
#include <asm/procinfo.h>
#include <asm/pgtable.h>

Expand Down
Loading

0 comments on commit 486a153

Please sign in to comment.