media: consolidation of -I flags
Subsystems (3)
RFC PATCH 1/1 media: consolidation of -I flags
I have been doing cleanup of makefiles, namely replacing the older style compilation flag variables with the newer style. While doing this, I noticed that the majority of drivers in the media subsystem seem to rely on a few core header files:
-Idrivers/media/video
-Idrivers/media/common/tuners
-Idrivers/media/dvb/dvb-core
-Idrivers/media/dvb/frontends
This patch removes them from the individual makefiles and puts them in the main makefile under media. Now I realize that not all of the drivers depend on these includes, but most do, and almost everything under video is already being built with these as it is. I can think of a few reasons why this might not be considered a _great_ idea; nevertheless, I still would like to see what everyone else thinks.
As an alternative, there could be a split division that does not include the entire media subsystem. Instead, the main makefiles under dvb and video could be modified to handle the needed include flags.
dvb/Makefile: subdir-ccflags-y += -Idrivers/media/common/tuners subdir-ccflags-y += -Idrivers/media/dvb/dvb-core subdir-ccflags-y += -Idrivers/media/dvb/frontends ... video/Makefile: subdir-ccflags-y := -Idrivers/media/video subdir-ccflags-y += -Idrivers/media/common/tuners subdir-ccflags-y += -Idrivers/media/dvb/dvb-core subdir-ccflags-y += -Idrivers/media/dvb/frontends ...
If neither idea is considered beneficial, I will go ahead and replace the older variables with the newer ones as is.
--- drivers/media/Makefile | 5 +++++ drivers/media/common/tuners/Makefile | 3 --- drivers/media/dvb/b2c2/Makefile | 3 --- drivers/media/dvb/bt8xx/Makefile | 3 --- drivers/media/dvb/dm1105/Makefile | 2 -- drivers/media/dvb/dvb-usb/Makefile | 5 ----- drivers/media/dvb/firewire/Makefile | 1 - drivers/media/dvb/frontends/Makefile | 3 --- drivers/media/dvb/mantis/Makefile | 2 -- drivers/media/dvb/ngene/Makefile | 4 ---- drivers/media/dvb/pluto2/Makefile | 2 -- drivers/media/dvb/pt1/Makefile | 2 -- drivers/media/dvb/siano/Makefile | 2 -- drivers/media/dvb/ttpci/Makefile | 3 --- drivers/media/dvb/ttusb-budget/Makefile | 2 -- drivers/media/dvb/ttusb-dec/Makefile | 2 -- drivers/media/video/Makefile | 4 ---- drivers/media/video/au0828/Makefile | 4 ---- drivers/media/video/bt8xx/Makefile | 4 ---- drivers/media/video/cx18/Makefile | 4 ---- drivers/media/video/cx231xx/Makefile | 6 ------ drivers/media/video/cx23885/Makefile | 5 ----- drivers/media/video/cx25840/Makefile | 2 -- drivers/media/video/cx88/Makefile | 5 ----- drivers/media/video/em28xx/Makefile | 6 ------ drivers/media/video/hdpvr/Makefile | 2 -- drivers/media/video/ivtv/Makefile | 6 ------ drivers/media/video/pvrusb2/Makefile | 5 ----- drivers/media/video/saa7134/Makefile | 5 ----- drivers/media/video/saa7164/Makefile | 5 ----- drivers/media/video/tlg2300/Makefile | 6 ------ drivers/media/video/usbvision/Makefile | 3 --- 32 files changed, 5 insertions(+), 111 deletions(-)
drivers/media/Makefile +5 -0
@@ -2,6 +2,11 @@ # Makefile for the kernel multimedia device drivers. # +subdir-ccflags-y := -Idrivers/media/video +subdir-ccflags-y += -Idrivers/media/common/tuners +subdir-ccflags-y += -Idrivers/media/dvb/dvb-core +subdir-ccflags-y += -Idrivers/media/dvb/frontends + obj-y += common/ IR/ video/ obj-$(CONFIG_VIDEO_DEV) += radio/
drivers/media/common/tuners/Makefile +0 -3
@@ -24,6 +24,3 @@ obj-$(CONFIG_MEDIA_TUNER_MXL5005S) += mxl5005s.o obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
drivers/media/dvb/b2c2/Makefile +0 -3
@@ -11,6 +11,3 @@ obj-$(CONFIG_DVB_B2C2_FLEXCOP_PCI) += b2c2-flexcop-pci.o b2c2-flexcop-usb-objs = flexcop-usb.o obj-$(CONFIG_DVB_B2C2_FLEXCOP_USB) += b2c2-flexcop-usb.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ -EXTRA_CFLAGS += -Idrivers/media/common/tuners/
drivers/media/dvb/bt8xx/Makefile +0 -3
@@ -1,6 +1,3 @@ obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o dst.o dst_ca.o -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends EXTRA_CFLAGS += -Idrivers/media/video/bt8xx -EXTRA_CFLAGS += -Idrivers/media/common/tuners
drivers/media/dvb/dm1105/Makefile +0 -2
@@ -1,3 +1 @@ obj-$(CONFIG_DVB_DM1105) += dm1105.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends
drivers/media/dvb/dvb-usb/Makefile +0 -5
@@ -87,8 +87,3 @@ obj-$(CONFIG_DVB_USB_EC168) += dvb-usb-ec168.o dvb-usb-az6027-objs = az6027.o obj-$(CONFIG_DVB_USB_AZ6027) += dvb-usb-az6027.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ -# due to tuner-xc3028 -EXTRA_CFLAGS += -Idrivers/media/common/tuners -
drivers/media/dvb/firewire/Makefile +0 -1
@@ -5,5 +5,4 @@ firedtv-$(CONFIG_DVB_FIREDTV_FIREWIRE) += firedtv-fw.o firedtv-$(CONFIG_DVB_FIREDTV_IEEE1394) += firedtv-1394.o firedtv-$(CONFIG_DVB_FIREDTV_INPUT) += firedtv-rc.o -ccflags-y += -Idrivers/media/dvb/dvb-core ccflags-$(CONFIG_DVB_FIREDTV_IEEE1394) += -Idrivers/ieee1394
drivers/media/dvb/frontends/Makefile +0 -3
@@ -2,9 +2,6 @@ # Makefile for the kernel DVB frontend device drivers. # -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -EXTRA_CFLAGS += -Idrivers/media/common/tuners/ - s921-objs := s921_module.o s921_core.o stb0899-objs = stb0899_drv.o stb0899_algo.o stv0900-objs = stv0900_core.o stv0900_sw.o
drivers/media/dvb/mantis/Makefile +0 -2
@@ -24,5 +24,3 @@ hopper-objs := hopper_cards.o \ obj-$(CONFIG_MANTIS_CORE) += mantis_core.o obj-$(CONFIG_DVB_MANTIS) += mantis.o obj-$(CONFIG_DVB_HOPPER) += hopper.o - -EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
drivers/media/dvb/ngene/Makefile +0 -4
@@ -5,7 +5,3 @@ ngene-objs := ngene-core.o ngene-i2c.o ngene-cards.o ngene-dvb.o obj-$(CONFIG_DVB_NGENE) += ngene.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends/ -EXTRA_CFLAGS += -Idrivers/media/common/tuners/
drivers/media/dvb/pluto2/Makefile +0 -2
@@ -1,3 +1 @@ obj-$(CONFIG_DVB_PLUTO2) += pluto2.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
drivers/media/dvb/pt1/Makefile +0 -2
@@ -1,5 +1,3 @@ earth-pt1-objs := pt1.o va1j5jf8007s.o va1j5jf8007t.o obj-$(CONFIG_DVB_PT1) += earth-pt1.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -Idrivers/media/dvb/frontends
drivers/media/dvb/siano/Makefile +0 -2
@@ -5,7 +5,5 @@ obj-$(CONFIG_SMS_SIANO_MDTV) += smsmdtv.o smsdvb.o obj-$(CONFIG_SMS_USB_DRV) += smsusb.o obj-$(CONFIG_SMS_SDIO_DRV) += smssdio.o -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core - EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m)
drivers/media/dvb/ttpci/Makefile +0 -3
@@ -16,6 +16,3 @@ obj-$(CONFIG_DVB_BUDGET_AV) += budget-av.o obj-$(CONFIG_DVB_BUDGET_CI) += budget-ci.o obj-$(CONFIG_DVB_BUDGET_PATCH) += budget-patch.o obj-$(CONFIG_DVB_AV7110) += dvb-ttpci.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ -EXTRA_CFLAGS += -Idrivers/media/common/tuners
drivers/media/dvb/ttusb-budget/Makefile +0 -2
@@ -1,3 +1 @@ obj-$(CONFIG_DVB_TTUSB_BUDGET) += dvb-ttusb-budget.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends
drivers/media/dvb/ttusb-dec/Makefile +0 -2
@@ -1,3 +1 @@ obj-$(CONFIG_DVB_TTUSB_DEC) += ttusb_dec.o ttusbdecfe.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/
drivers/media/video/Makefile +0 -4
@@ -179,7 +179,3 @@ obj-$(CONFIG_VIDEO_IR_I2C) += ir-kbd-i2c.o obj-y += davinci/ obj-$(CONFIG_ARCH_OMAP) += omap/ - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends -EXTRA_CFLAGS += -Idrivers/media/common/tuners
drivers/media/video/au0828/Makefile +0 -4
@@ -2,8 +2,4 @@ au0828-objs := au0828-core.o au0828-i2c.o au0828-cards.o au0828-dvb.o au0828-vid obj-$(CONFIG_VIDEO_AU0828) += au0828.o -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends - EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m)
drivers/media/video/bt8xx/Makefile +0 -4
@@ -7,7 +7,3 @@ bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \ bttv-input.o bttv-audio-hook.o obj-$(CONFIG_VIDEO_BT848) += bttv.o - -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
drivers/media/video/cx18/Makefile +0 -4
@@ -7,7 +7,3 @@ cx18-alsa-objs := cx18-alsa-main.o cx18-alsa-pcm.o obj-$(CONFIG_VIDEO_CX18) += cx18.o obj-$(CONFIG_VIDEO_CX18_ALSA) += cx18-alsa.o - -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends -EXTRA_CFLAGS += -Idrivers/media/common/tuners
drivers/media/video/cx231xx/Makefile +0 -6
@@ -6,9 +6,3 @@ cx231xx-alsa-objs := cx231xx-audio.o obj-$(CONFIG_VIDEO_CX231XX) += cx231xx.o obj-$(CONFIG_VIDEO_CX231XX_ALSA) += cx231xx-alsa.o obj-$(CONFIG_VIDEO_CX231XX_DVB) += cx231xx-dvb.o - -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends -
drivers/media/video/cx23885/Makefile +0 -5
@@ -6,9 +6,4 @@ cx23885-objs := cx23885-cards.o cx23885-video.o cx23885-vbi.o \ obj-$(CONFIG_VIDEO_CX23885) += cx23885.o -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends - EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m)
drivers/media/video/cx25840/Makefile +0 -2
@@ -2,5 +2,3 @@ cx25840-objs := cx25840-core.o cx25840-audio.o cx25840-firmware.o \ cx25840-vbi.o cx25840-ir.o obj-$(CONFIG_VIDEO_CX25840) += cx25840.o - -EXTRA_CFLAGS += -Idrivers/media/video
drivers/media/video/cx88/Makefile +0 -5
@@ -9,8 +9,3 @@ obj-$(CONFIG_VIDEO_CX88_ALSA) += cx88-alsa.o obj-$(CONFIG_VIDEO_CX88_BLACKBIRD) += cx88-blackbird.o obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o obj-$(CONFIG_VIDEO_CX88_VP3054) += cx88-vp3054-i2c.o - -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
drivers/media/video/em28xx/Makefile +0 -6
@@ -6,9 +6,3 @@ em28xx-alsa-objs := em28xx-audio.o obj-$(CONFIG_VIDEO_EM28XX) += em28xx.o obj-$(CONFIG_VIDEO_EM28XX_ALSA) += em28xx-alsa.o obj-$(CONFIG_VIDEO_EM28XX_DVB) += em28xx-dvb.o - -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends -
drivers/media/video/hdpvr/Makefile +0 -2
@@ -4,6 +4,4 @@ hdpvr-$(CONFIG_I2C) += hdpvr-i2c.o obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.o -EXTRA_CFLAGS += -Idrivers/media/video - EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m)
drivers/media/video/ivtv/Makefile +0 -6
@@ -6,9 +6,3 @@ ivtv-objs := ivtv-routing.o ivtv-cards.o ivtv-controls.o \ obj-$(CONFIG_VIDEO_IVTV) += ivtv.o obj-$(CONFIG_VIDEO_FB_IVTV) += ivtvfb.o - -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends -
drivers/media/video/pvrusb2/Makefile +0 -5
@@ -15,8 +15,3 @@ pvrusb2-objs := pvrusb2-i2c-core.o \ $(obj-pvrusb2-sysfs-y) $(obj-pvrusb2-debugifc-y) obj-$(CONFIG_VIDEO_PVRUSB2) += pvrusb2.o - -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
drivers/media/video/saa7134/Makefile +0 -5
@@ -8,8 +8,3 @@ obj-$(CONFIG_VIDEO_SAA7134) += saa6752hs.o saa7134.o saa7134-empress.o obj-$(CONFIG_VIDEO_SAA7134_ALSA) += saa7134-alsa.o obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o - -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
drivers/media/video/saa7164/Makefile +0 -5
@@ -4,9 +4,4 @@ saa7164-objs := saa7164-cards.o saa7164-core.o saa7164-i2c.o saa7164-dvb.o \ obj-$(CONFIG_VIDEO_SAA7164) += saa7164.o -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends - EXTRA_CFLAGS += $(extra-cflags-y) $(extra-cflags-m)
drivers/media/video/tlg2300/Makefile +0 -6
@@ -1,9 +1,3 @@ poseidon-objs := pd-video.o pd-alsa.o pd-dvb.o pd-radio.o pd-main.o obj-$(CONFIG_VIDEO_TLG2300) += poseidon.o - -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners -EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -EXTRA_CFLAGS += -Idrivers/media/dvb/frontends -
drivers/media/video/usbvision/Makefile +0 -3
@@ -1,6 +1,3 @@ usbvision-objs := usbvision-core.o usbvision-video.o usbvision-i2c.o usbvision-cards.o obj-$(CONFIG_VIDEO_USBVISION) += usbvision.o - -EXTRA_CFLAGS += -Idrivers/media/video -EXTRA_CFLAGS += -Idrivers/media/common/tuners
Signature · 1 line
1.7.2.1
Quoted 5 lines · matt mooney
I have been doing cleanup of makefiles, namely replacing the older style compilation flag variables with the newer style. While doing this, I noticed that the majority of drivers in the media subsystem seem to rely on a few core header files:
Quoted 7 lines
-Idrivers/media/video
-Idrivers/media/common/tuners
-Idrivers/media/dvb/dvb-core
-Idrivers/media/dvb/frontendsThis patch removes them from the individual makefiles and puts them in the main makefile under media.
Using subdir-ccflags-y has one drawback you need to be aware of. The variable is _not_ picked up if you build individual drivers like this:
make drivers/media/dvb/b2c2/
So with this patch applied it is no longer possible to do so. It is better to accept the duplication rather than breaking the build of individual drivers.
Quoted 3 lines
If neither idea is considered beneficial, I will go ahead and replace the older variables with the newer ones as is.
This is the right approach.
You could consider to do a more general cleanup:
1) replace EXTRA_CFLAGS with ccflags-y (the one you suggest)
2) replace use of <module>-objs with <module>-y
3) break continued lines into several assignments
People very often uses '\' to break long lines, where a
simple += would be much more readable.
But this topic may be personal - I never uses "\" in my .c code unless in macros, and I have applied the same rule for Makefiles.
An ugly example is drivers/media/Makefile
4) In general use ":=" instead of "=".
Add using "+=" as first assignment is OK - but it just looks plain wrong
5) some files has a mixture of spaces/tabs (are red in my vim) dvb-core/Makefile is one such example
6) remove useless stuff
siano/Makefile has some strange assignments to EXTRA_CFLAGS
7) Likely a few more items to look after...
This is more work - but then you finish a Makefile rather than doing a simple conversion.
Sam
Quoted 18 lines · Sam Ravnborg
Quoted 5 lines · matt mooney
I have been doing cleanup of makefiles, namely replacing the older style compilation flag variables with the newer style. While doing this, I noticed that the majority of drivers in the media subsystem seem to rely on a few core header files:
Quoted 7 lines
-Idrivers/media/video
-Idrivers/media/common/tuners
-Idrivers/media/dvb/dvb-core
-Idrivers/media/dvb/frontendsThis patch removes them from the individual makefiles and puts them in the main makefile under media.
Using subdir-ccflags-y has one drawback you need to be aware of. The variable is _not_ picked up if you build individual drivers like this:
Quoted 5 lines
make
drivers/media/dvb/b2c2/So with this patch applied it is no longer possible to do so. It is better to accept the duplication rather than breaking the build of individual drivers.
Ah, I was not aware of that, and I forgot to test for that case.
Quoted 23 lines
Quoted 3 lines
If neither idea is considered beneficial, I will go ahead and replace the older variables with the newer ones as is.
This is the right approach.
You could consider to do a more general cleanup:
1) replaceEXTRA_CFLAGSwith ccflags-y (the one you suggest)
2) replace use of <module>-objs with <module>-y
3) break continued lines into several assignments
People very often uses '\' to break long lines, where a
simple += would be much more readable.
But this topic may be personal - I never uses "\" in my .c code unless in macros, and I have applied the same rule for Makefiles.
An ugly example isdrivers/media/Makefile
4) In general use ":=" instead of "=".
Add using "+=" as first assignment is OK - but it just looks plain wrong
5) some files has a mixture of spaces/tabs (are red in my vim) dvb-core/Makefile is one such example
6) remove useless stuff
siano/Makefile has some strange assignments toEXTRA_CFLAGS
7) Likely a few more items to look after...
Quoted 2 lines
This is more work - but then you finish a
Makefilerather than doing a simple conversion.
I agree with all your points above; however, I was unsure of whether a wholesale cleanup would be welcomed because I would then end up touching numerous lines (and in some cases, possibly all lines). I did notice, though, the need for quite a bit of cleanup like you have mentioned, and I have a few patches queued up that make a second pass on some files changing <module>-objs to <module>-y. You know better than I do, so if you feel I should cleanup the whole file in one patch, then that is what I will do although this will take some time.
Is the use of <module>-objs deprecated? Some people might wonder why I am changing that when they are not building a multisource object.
Thanks,
mfm
Quoted 28 lines · Sam Ravnborg
Quoted 5 lines · matt mooney
I have been doing cleanup of makefiles, namely replacing the older style compilation flag variables with the newer style. While doing this, I noticed that the majority of drivers in the media subsystem seem to rely on a few core header files:
Quoted 7 lines
-Idrivers/media/video
-Idrivers/media/common/tuners
-Idrivers/media/dvb/dvb-core
-Idrivers/media/dvb/frontendsThis patch removes them from the individual makefiles and puts them in the main makefile under media.
Using subdir-ccflags-y has one drawback you need to be aware of. The variable is _not_ picked up if you build individual drivers like this:
make
drivers/media/dvb/b2c2/So with this patch applied it is no longer possible to do so. It is better to accept the duplication rather than breaking the build of individual drivers.
Quoted 3 lines
If neither idea is considered beneficial, I will go ahead and replace the older variables with the newer ones as is.
Quoted 6 lines
This is the right approach.
You could consider to do a more general cleanup:
1) replaceEXTRA_CFLAGSwith ccflags-y (the one you suggest)
2) replace use of <module>-objs with <module>-y
3) break continued lines into several assignments
I have a question when you say this do you mean change something like this:
r8187se-objs :
to
r8187se-y :
If so, I could start working on that in the staging directory.
Quoted 18 lines
People very often uses '\' to break long lines, where a simple += would be much more readable.
But this topic may be personal - I never uses "\" in my .c code unless in
macros,
and I have applied the same rule for Makefiles.
An ugly example isdrivers/media/Makefile
4) In general use ":=" instead of "=".
Add using "+=" as first assignment is OK - but it just looks plain wrong
5) some files has a mixture of spaces/tabs (are red in my vim) dvb-core/Makefile is one such example
6) remove useless stuff
siano/Makefile has some strange assignments toEXTRA_CFLAGS
7) Likely a few more items to look after...This is more work - but then you finish a
Makefilerather than doing a simple
conversion.
Quoted 7 lines
Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Thanks,
Tracey D
Quoted 36 lines · T Dent
Quoted 28 lines · Sam Ravnborg
Quoted 5 lines · matt mooney
I have been doing cleanup of makefiles, namely replacing the older style compilation flag variables with the newer style. While doing this, I noticed that the majority of drivers in the media subsystem seem to rely on a few core header files:
Quoted 7 lines
-Idrivers/media/video
-Idrivers/media/common/tuners
-Idrivers/media/dvb/dvb-core
-Idrivers/media/dvb/frontendsThis patch removes them from the individual makefiles and puts them in the main makefile under media.
Using subdir-ccflags-y has one drawback you need to be aware of. The variable is _not_ picked up if you build individual drivers like this:
make
drivers/media/dvb/b2c2/So with this patch applied it is no longer possible to do so. It is better to accept the duplication rather than breaking the build of individual drivers.
Quoted 3 lines
If neither idea is considered beneficial, I will go ahead and replace the older variables with the newer ones as is.
Quoted 6 lines
This is the right approach.
You could consider to do a more general cleanup:
1) replaceEXTRA_CFLAGSwith ccflags-y (the one you suggest)
2) replace use of <module>-objs with <module>-y
3) break continued lines into several assignments
Quoted 6 lines
I have a question when you say this do you mean change something like this:
r8187se-objs :>
tor8187se-y :
Yes, that is what is meant, but remember to change conditional inclusions to the kbuild idiom.
Quoted 1 line
If so, I could start working on that in the staging directory.
That's cool; the staging makefiles need extra attention though, so you really need to go through and make sure you understand what is and isn't needed. And check to see what drivers are on their way out so that you don't waste your time.
Now, I do have some of these queued up for other parts of the kernel, so please let me know before you start sending in patches for other parts that I have already worked on.
Thanks,
mfm
Quoted 34 lines
Quoted 18 lines
People very often uses '\' to break long lines, where a simple += would be much more readable.
But this topic may be personal - I never uses "\" in my .c code unless in
macros,
and I have applied the same rule for Makefiles.
An ugly example isdrivers/media/Makefile
4) In general use ":=" instead of "=".
Add using "+=" as first assignment is OK - but it just looks plain wrong
5) some files has a mixture of spaces/tabs (are red in my vim) dvb-core/Makefile is one such example
6) remove useless stuff
siano/Makefile has some strange assignments toEXTRA_CFLAGS
7) Likely a few more items to look after...This is more work - but then you finish a
Makefilerather than doing a simple
conversion.Quoted 7 lines
Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/Thanks,
Tracey D
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 42 lines · matt mooney
Quoted 41 lines · T Dent
Quoted 30 lines · Sam Ravnborg
Quoted 7 lines · matt mooney
I have been doing cleanup of makefiles, namely replacing the older style
compilation flag variables with the newer style. While doing this, I noticed that the majority of drivers in the media subsystem seem to rely
on a few core header files:Quoted 7 lines
-Idrivers/media/video
-Idrivers/media/common/tuners
-Idrivers/media/dvb/dvb-core
-Idrivers/media/dvb/frontendsThis patch removes them from the individual makefiles and puts them in the main makefile under media.
Using subdir-ccflags-y has one drawback you need to be aware of. The variable is _not_ picked up if you build individual drivers like this:
make
drivers/media/dvb/b2c2/So with this patch applied it is no longer possible to do so. It is better to accept the duplication rather than breaking the build of individual drivers.
Quoted 3 lines
If neither idea is considered beneficial, I will go ahead and replace the older variables with the newer ones as is.
Quoted 6 lines
This is the right approach.
You could consider to do a more general cleanup:
1) replaceEXTRA_CFLAGSwith ccflags-y (the one you suggest)
2) replace use of <module>-objs with <module>-y
3) break continued lines into several assignmentsI have a question when you say this do you mean change something like this:
Quoted 7 lines
Quoted 4 lines
r8187se-objs :>>
tor8187se-y :>
Yes, that is what is meant, but remember to change conditional inclusions to the
kbuild idiom.
Okay, I get start on it right away.
Quoted 10 lines
Quoted 2 lines
If so, I could start working on that in the staging directory.
That's cool; the staging makefiles need extra attention though, so you really
need to go through and make sure you understand what is and isn't needed. And
check to see what drivers are on their way out so that you don't waste your time.
Quoted 4 lines
Now, I do have some of these queued up for other parts of the kernel, so please
let me know before you start sending in patches for other parts that I have already worked on.
I message you if haven't sent the patches in, yet to see what you did or are doing.
Quoted 42 lines
Thanks,
mfmQuoted 37 lines
Quoted 20 lines
People very often uses '\' to break long lines, where a simple += would be much more readable.
But this topic may be personal - I never uses "\" in my .c code
unless in
macros,
and I have applied the same rule for Makefiles.
An ugly example isdrivers/media/Makefile
4) In general use ":=" instead of "=".
Add using "+=" as first assignment is OK - but it just looks plain
wrong
5) some files has a mixture of spaces/tabs (are red in my vim) dvb-core/Makefile is one such example
6) remove useless stuff
siano/Makefile has some strange assignments toEXTRA_CFLAGS
7) Likely a few more items to look after...This is more work - but then you finish a
Makefilerather than doing a simple
conversion.Quoted 8 lines
Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/Thanks,
Tracey D
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks,
Tracey D
Quoted 62 lines · matt mooney
Quoted 18 lines · Sam Ravnborg
Quoted 5 lines · matt mooney
I have been doing cleanup of makefiles, namely replacing the older style compilation flag variables with the newer style. While doing this, I noticed that the majority of drivers in the media subsystem seem to rely on a few core header files:
Quoted 7 lines
-Idrivers/media/video
-Idrivers/media/common/tuners
-Idrivers/media/dvb/dvb-core
-Idrivers/media/dvb/frontendsThis patch removes them from the individual makefiles and puts them in the main makefile under media.
Using subdir-ccflags-y has one drawback you need to be aware of. The variable is _not_ picked up if you build individual drivers like this:
Quoted 5 lines
make
drivers/media/dvb/b2c2/So with this patch applied it is no longer possible to do so. It is better to accept the duplication rather than breaking the build of individual drivers.
Ah, I was not aware of that, and I forgot to test for that case.
Quoted 23 lines
Quoted 3 lines
If neither idea is considered beneficial, I will go ahead and replace the older variables with the newer ones as is.
This is the right approach.
You could consider to do a more general cleanup:
1) replaceEXTRA_CFLAGSwith ccflags-y (the one you suggest)
2) replace use of <module>-objs with <module>-y
3) break continued lines into several assignments
People very often uses '\' to break long lines, where a
simple += would be much more readable.
But this topic may be personal - I never uses "\" in my .c code unless in macros, and I have applied the same rule for Makefiles.
An ugly example isdrivers/media/Makefile
4) In general use ":=" instead of "=".
Add using "+=" as first assignment is OK - but it just looks plain wrong
5) some files has a mixture of spaces/tabs (are red in my vim) dvb-core/Makefile is one such example
6) remove useless stuff
siano/Makefile has some strange assignments toEXTRA_CFLAGS
7) Likely a few more items to look after...Quoted 2 lines
This is more work - but then you finish a
Makefilerather than doing a simple conversion.I agree with all your points above; however, I was unsure of whether a wholesale cleanup would be welcomed because I would then end up touching numerous lines (and in some cases, possibly all lines). I did notice, though, the need for quite a bit of cleanup like you have mentioned, and I have a few patches queued up that make a second pass on some files changing <module>-objs to <module>-y. You know better than I do, so if you feel I should cleanup the whole file in one patch, then that is what I will do although this will take some time.
Quoted 2 lines
Is the use of <module>-objs deprecated? Some people might wonder why I am changing that when they are not building a multisource object.
I just realized I stated that wrong. I meant when they are not using a conditional inclusion of sources.
Thanks,
mfm
Quoted 26 lines
Ah, I was not aware of that, and I forgot to test for that case.
Quoted 23 lines
Quoted 3 lines
If neither idea is considered beneficial, I will go ahead and replace the older variables with the newer ones as is.
This is the right approach.
You could consider to do a more general cleanup:
1) replaceEXTRA_CFLAGSwith ccflags-y (the one you suggest)
2) replace use of <module>-objs with <module>-y
3) break continued lines into several assignments
People very often uses '\' to break long lines, where a
simple += would be much more readable.
But this topic may be personal - I never uses "\" in my .c code unless in macros, and I have applied the same rule for Makefiles.
An ugly example isdrivers/media/Makefile
4) In general use ":=" instead of "=".
Add using "+=" as first assignment is OK - but it just looks plain wrong
5) some files has a mixture of spaces/tabs (are red in my vim) dvb-core/Makefile is one such example
6) remove useless stuff
siano/Makefile has some strange assignments toEXTRA_CFLAGS
7) Likely a few more items to look after...
Quoted 6 lines
Quoted 2 lines
This is more work - but then you finish a
Makefilerather than doing a simple conversion.I agree with all your points above; however, I was unsure of whether a wholesale cleanup would be welcomed because I would then end up touching numerous lines (and in some cases, possibly all lines).
The Makefiles are all very simple - so touching all lines in a files is not a big deal here. But then you would have to batch your changes in smaller parts touching only a few Makefiles/one Makefile per patch.
Quoted 2 lines
Is the use of <module>-objs deprecated? Some people might wonder why I am changing that when they are not building a multisource object.
I always recommends the <module>-y notation.
Because this version has the flexibility to use the kbuild way of dealing with conditional modules.
I see no reason to do such change alaone - but as part of other minor cleanups it would be natural to change to the <module>-y idiom.
All the comments above is valid for staging too. There we should try to do general cleanup on the Makefile rather than a lot of small edits.
But sometimes the MAkefiles contains so much legacy that this will be more than one patch..
Sam