diff options
author | Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> | 2005-05-05 19:15:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-05 19:36:33 -0400 |
commit | 776cfebb430c7b22c208b1b17add97f354d97cab (patch) | |
tree | a4029d17947423ff8cdf12757e3434eb31e0dcba | |
parent | 0c28130b5c9e8f0b153436d3dae39482e5a70af1 (diff) |
[PATCH] uml kbuild: avoid useless rebuilds
- Fix some problems with usage of $(targets) (sometimes missing, sometimes
used badly) that trigger partial rebuilds when doing a rebuild.
- At that purpose, also factor out some common code for symlinks creation.
- Fix a x86-64 build warning, caused by -L/usr/lib, which is anyway useless,
and invalid in the x86-64 case.
Tested on x86_64 and x86.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/um/Makefile | 2 | ||||
-rw-r--r-- | arch/um/kernel/Makefile | 4 | ||||
-rw-r--r-- | arch/um/kernel/tt/Makefile | 1 | ||||
-rw-r--r-- | arch/um/scripts/Makefile.rules | 16 | ||||
-rw-r--r-- | arch/um/sys-i386/Makefile | 15 | ||||
-rw-r--r-- | arch/um/sys-x86_64/Makefile | 11 |
6 files changed, 21 insertions, 28 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile index 97bca6b5ca95..6f75fb251359 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -126,7 +126,7 @@ define cmd_vmlinux__ | |||
126 | $(CC) $(CFLAGS_vmlinux) -o $@ \ | 126 | $(CC) $(CFLAGS_vmlinux) -o $@ \ |
127 | -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ | 127 | -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ |
128 | -Wl,--start-group $(vmlinux-main) -Wl,--end-group \ | 128 | -Wl,--start-group $(vmlinux-main) -Wl,--end-group \ |
129 | -L/usr/lib -lutil \ | 129 | -lutil \ |
130 | $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) \ | 130 | $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) \ |
131 | FORCE ,$^) ; rm -f linux | 131 | FORCE ,$^) ; rm -f linux |
132 | endef | 132 | endef |
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile index 246f0e7fb4cc..a9dd6933dfc3 100644 --- a/arch/um/kernel/Makefile +++ b/arch/um/kernel/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | # | 4 | # |
5 | 5 | ||
6 | extra-y := vmlinux.lds | 6 | extra-y := vmlinux.lds |
7 | clean-files := vmlinux.lds.S config.tmp | 7 | clean-files := vmlinux.lds.S |
8 | 8 | ||
9 | obj-y = checksum.o config.o exec_kern.o exitcode.o \ | 9 | obj-y = checksum.o config.o exec_kern.o exitcode.o \ |
10 | helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \ | 10 | helper.o init_task.o irq.o irq_user.o ksyms.o main.o mem.o mem_user.o \ |
@@ -34,7 +34,7 @@ USER_OBJS := $(user-objs-y) config.o helper.o main.o process.o tempfile.o \ | |||
34 | 34 | ||
35 | include arch/um/scripts/Makefile.rules | 35 | include arch/um/scripts/Makefile.rules |
36 | 36 | ||
37 | targets += config.c | 37 | targets := config.c config.tmp |
38 | 38 | ||
39 | # Be careful with the below Sed code - sed is pitfall-rich! | 39 | # Be careful with the below Sed code - sed is pitfall-rich! |
40 | # We use sed to lower build requirements, for "embedded" builders for instance. | 40 | # We use sed to lower build requirements, for "embedded" builders for instance. |
diff --git a/arch/um/kernel/tt/Makefile b/arch/um/kernel/tt/Makefile index 3d5177df3504..c3faea21a996 100644 --- a/arch/um/kernel/tt/Makefile +++ b/arch/um/kernel/tt/Makefile | |||
@@ -4,6 +4,7 @@ | |||
4 | # | 4 | # |
5 | 5 | ||
6 | extra-y := unmap_fin.o | 6 | extra-y := unmap_fin.o |
7 | targets := unmap.o | ||
7 | clean-files := unmap_tmp.o | 8 | clean-files := unmap_tmp.o |
8 | 9 | ||
9 | obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \ | 10 | obj-y = exec_kern.o exec_user.o gdb.o ksyms.o mem.o mem_user.o process_kern.o \ |
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules index 143f6fea0763..ea3c8745fb6e 100644 --- a/arch/um/scripts/Makefile.rules +++ b/arch/um/scripts/Makefile.rules | |||
@@ -10,4 +10,18 @@ USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) | |||
10 | $(USER_OBJS): c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) | 10 | $(USER_OBJS): c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) |
11 | 11 | ||
12 | quiet_cmd_make_link = SYMLINK $@ | 12 | quiet_cmd_make_link = SYMLINK $@ |
13 | cmd_make_link = rm -f $@; ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@ | 13 | cmd_make_link = ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir $@)-dir)/$(notdir $@) $@ |
14 | |||
15 | # this needs to be before the foreach, because targets does not accept | ||
16 | # complete paths like $(obj)/$(f). To make sure this works, use a := assignment, | ||
17 | # or we will get $(obj)/$(f) in the "targets" value. | ||
18 | # Also, this forces you to use the := syntax when assigning to targets. | ||
19 | # Otherwise the line below will cause an infinite loop (if you don't know why, | ||
20 | # just do it). | ||
21 | |||
22 | targets := $(targets) $(SYMLINKS) | ||
23 | |||
24 | SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$(f)) | ||
25 | |||
26 | $(SYMLINKS): FORCE | ||
27 | $(call if_changed,make_link) | ||
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile index 950781e354de..fcd67c3414e4 100644 --- a/arch/um/sys-i386/Makefile +++ b/arch/um/sys-i386/Makefile | |||
@@ -7,24 +7,13 @@ obj-$(CONFIG_MODULES) += module.o | |||
7 | 7 | ||
8 | USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o | 8 | USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o |
9 | 9 | ||
10 | include arch/um/scripts/Makefile.rules | ||
11 | |||
12 | SYMLINKS = bitops.c semaphore.c highmem.c module.c | 10 | SYMLINKS = bitops.c semaphore.c highmem.c module.c |
13 | 11 | ||
14 | # this needs to be before the foreach, because clean-files does not accept | ||
15 | # complete paths like $(src)/$f. | ||
16 | clean-files := $(SYMLINKS) | ||
17 | |||
18 | targets += $(SYMLINKS) | ||
19 | |||
20 | SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$f) | ||
21 | |||
22 | bitops.c-dir = lib | 12 | bitops.c-dir = lib |
23 | semaphore.c-dir = kernel | 13 | semaphore.c-dir = kernel |
24 | highmem.c-dir = mm | 14 | highmem.c-dir = mm |
25 | module.c-dir = kernel | 15 | module.c-dir = kernel |
26 | 16 | ||
27 | $(SYMLINKS): FORCE | ||
28 | $(call if_changed,make_link) | ||
29 | |||
30 | subdir- := util | 17 | subdir- := util |
18 | |||
19 | include arch/um/scripts/Makefile.rules | ||
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile index e60c9da8fb48..d6094281aa53 100644 --- a/arch/um/sys-x86_64/Makefile +++ b/arch/um/sys-x86_64/Makefile | |||
@@ -19,14 +19,6 @@ include arch/um/scripts/Makefile.rules | |||
19 | SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \ | 19 | SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \ |
20 | semaphore.c thunk.S module.c | 20 | semaphore.c thunk.S module.c |
21 | 21 | ||
22 | # this needs to be before the foreach, because clean-files does not accept | ||
23 | # complete paths like $(src)/$f. | ||
24 | clean-files := $(SYMLINKS) | ||
25 | |||
26 | targets += $(SYMLINKS) | ||
27 | |||
28 | SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$f) | ||
29 | |||
30 | bitops.c-dir = lib | 22 | bitops.c-dir = lib |
31 | csum-copy.S-dir = lib | 23 | csum-copy.S-dir = lib |
32 | csum-partial.c-dir = lib | 24 | csum-partial.c-dir = lib |
@@ -36,7 +28,4 @@ semaphore.c-dir = kernel | |||
36 | thunk.S-dir = lib | 28 | thunk.S-dir = lib |
37 | module.c-dir = kernel | 29 | module.c-dir = kernel |
38 | 30 | ||
39 | $(SYMLINKS): FORCE | ||
40 | $(call if_changed,make_link) | ||
41 | |||
42 | CFLAGS_csum-partial.o := -Dcsum_partial=arch_csum_partial | 31 | CFLAGS_csum-partial.o := -Dcsum_partial=arch_csum_partial |