aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.com>2015-10-27 09:02:24 -0400
committerMichal Marek <mmarek@suse.com>2015-11-25 05:23:25 -0500
commitcf4f21938e13ea1533ebdcb21c46f1d998a44ee8 (patch)
treeb26af8415bc9f916124e27b4bbfd3209270e40f6
parent0046a46a8f93f5b99b499118779521ba3b017d69 (diff)
kbuild: Allow to specify composite modules with modname-m
This allows to write drm-$(CONFIG_AGP) += drm_agpsupport.o without having to handle CONFIG_AGP=y vs. CONFIG_AGP=m. Only support this syntax for modules, since built-in code depending on something modular cannot work and init/Makefile actually relies on the current semantics. There are a few drivers which adapted to the current semantics out of necessity; these are fixed to also work when the respective subsystem is modular. Acked-by: Peter Chen <peter.chen@freescale.com> [chipidea] Signed-off-by: Michal Marek <mmarek@suse.com>
-rw-r--r--drivers/misc/ibmasm/ibmasm.h2
-rw-r--r--drivers/usb/chipidea/otg_fsm.h2
-rw-r--r--fs/logfs/logfs.h2
-rw-r--r--scripts/Makefile.build8
-rw-r--r--scripts/Makefile.lib4
5 files changed, 11 insertions, 7 deletions
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 9b083448814d..5bd127727d8e 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -211,7 +211,7 @@ void ibmasmfs_unregister(void);
211void ibmasmfs_add_sp(struct service_processor *sp); 211void ibmasmfs_add_sp(struct service_processor *sp);
212 212
213/* uart */ 213/* uart */
214#ifdef CONFIG_SERIAL_8250 214#if IS_ENABLED(CONFIG_SERIAL_8250)
215void ibmasm_register_uart(struct service_processor *sp); 215void ibmasm_register_uart(struct service_processor *sp);
216void ibmasm_unregister_uart(struct service_processor *sp); 216void ibmasm_unregister_uart(struct service_processor *sp);
217#else 217#else
diff --git a/drivers/usb/chipidea/otg_fsm.h b/drivers/usb/chipidea/otg_fsm.h
index 2689375ae5da..262d6ef8df7c 100644
--- a/drivers/usb/chipidea/otg_fsm.h
+++ b/drivers/usb/chipidea/otg_fsm.h
@@ -62,7 +62,7 @@
62/* SSEND time before SRP */ 62/* SSEND time before SRP */
63#define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */ 63#define TB_SSEND_SRP (1500) /* minimum 1.5 sec, section:5.1.2 */
64 64
65#ifdef CONFIG_USB_OTG_FSM 65#if IS_ENABLED(CONFIG_USB_OTG_FSM)
66 66
67int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci); 67int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci);
68int ci_otg_fsm_work(struct ci_hdrc *ci); 68int ci_otg_fsm_work(struct ci_hdrc *ci);
diff --git a/fs/logfs/logfs.h b/fs/logfs/logfs.h
index 5f0937609465..23f961a8fb92 100644
--- a/fs/logfs/logfs.h
+++ b/fs/logfs/logfs.h
@@ -485,7 +485,7 @@ static inline int logfs_get_sb_bdev(struct logfs_super *s,
485#endif 485#endif
486 486
487/* dev_mtd.c */ 487/* dev_mtd.c */
488#ifdef CONFIG_MTD 488#if IS_ENABLED(CONFIG_MTD)
489int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr); 489int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr);
490#else 490#else
491static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr) 491static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 01df30af4d4a..2c47f9c305aa 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -372,10 +372,14 @@ endif
372# <composite-object>-objs := <list of .o files> 372# <composite-object>-objs := <list of .o files>
373# or 373# or
374# <composite-object>-y := <list of .o files> 374# <composite-object>-y := <list of .o files>
375# or
376# <composite-object>-m := <list of .o files>
377# The -m syntax only works if <composite object> is a module
375link_multi_deps = \ 378link_multi_deps = \
376$(filter $(addprefix $(obj)/, \ 379$(filter $(addprefix $(obj)/, \
377$($(subst $(obj)/,,$(@:.o=-objs))) \ 380$($(subst $(obj)/,,$(@:.o=-objs))) \
378$($(subst $(obj)/,,$(@:.o=-y)))), $^) 381$($(subst $(obj)/,,$(@:.o=-y))) \
382$($(subst $(obj)/,,$(@:.o=-m)))), $^)
379 383
380quiet_cmd_link_multi-y = LD $@ 384quiet_cmd_link_multi-y = LD $@
381cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis) 385cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
@@ -390,7 +394,7 @@ $(call multi_depend, $(multi-used-y), .o, -objs -y)
390$(multi-used-m): FORCE 394$(multi-used-m): FORCE
391 $(call if_changed,link_multi-m) 395 $(call if_changed,link_multi-m)
392 @{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod) 396 @{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod)
393$(call multi_depend, $(multi-used-m), .o, -objs -y) 397$(call multi_depend, $(multi-used-m), .o, -objs -y -m)
394 398
395targets += $(multi-used-y) $(multi-used-m) 399targets += $(multi-used-y) $(multi-used-m)
396 400
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 79e86613712f..e18957b7a830 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -48,7 +48,7 @@ subdir-ym := $(sort $(subdir-y) $(subdir-m))
48 48
49# if $(foo-objs) exists, foo.o is a composite object 49# if $(foo-objs) exists, foo.o is a composite object
50multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) 50multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
51multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) 51multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m))))
52multi-used := $(multi-used-y) $(multi-used-m) 52multi-used := $(multi-used-y) $(multi-used-m)
53single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m))) 53single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m)))
54 54
@@ -67,7 +67,7 @@ obj-dirs := $(dir $(multi-objs) $(obj-y))
67 67
68# Replace multi-part objects by their individual parts, look at local dir only 68# Replace multi-part objects by their individual parts, look at local dir only
69real-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) 69real-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)
70real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) 70real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
71 71
72# Add subdir path 72# Add subdir path
73 73