4b4b5054dabadd317ae284000576e05662516740
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0151-Makefiles-change-EXTRA_CFLAGS-to-ccflags-y.patch
1 From 6544998027a0bb96d3f64ec5429757344c9a729a Mon Sep 17 00:00:00 2001
2 From: Daniel Santos <daniel.santos@pobox.com>
3 Date: Fri, 3 Jan 2014 17:52:19 -0600
4 Subject: [PATCH 151/174] Makefiles: change EXTRA_CFLAGS to ccflags-y
5
6 According to section 3.7 of Documentation/kbuild/makefiles.txt, using
7 EXTRA_CFLAGS in Makefiles is "still supported but their usage is
8 deprecated." However, using make EXTRA_CFLAGS="-DSOMETHING" results in
9 EXTRA_CFLAGS from Makefiles being overwritten, obviously breaking the
10 build.  This patch converts to them to the newer ccflags-y which also
11 fixes the problem.
12 ---
13  drivers/char/broadcom/vc_cma/Makefile           | 18 ++++++++--------
14  drivers/misc/vc04_services/Makefile             |  2 +-
15  drivers/usb/host/dwc_common_port/Makefile       | 22 +++++++++----------
16  drivers/usb/host/dwc_common_port/Makefile.linux | 20 +++++++++---------
17  drivers/usb/host/dwc_otg/Makefile               | 28 ++++++++++++-------------
18  sound/arm/Makefile                              |  2 +-
19  6 files changed, 46 insertions(+), 46 deletions(-)
20
21 --- a/drivers/char/broadcom/vc_cma/Makefile
22 +++ b/drivers/char/broadcom/vc_cma/Makefile
23 @@ -1,12 +1,12 @@
24 -EXTRA_CFLAGS  += -Wall -Wstrict-prototypes -Wno-trigraphs
25 -EXTRA_CFLAGS  += -Werror
26 -EXTRA_CFLAGS  += -I"drivers/misc/vc04_services"
27 -EXTRA_CFLAGS  += -I"drivers/misc/vc04_services/interface/vchi"
28 -EXTRA_CFLAGS  += -I"drivers/misc/vc04_services/interface/vchiq_arm"
29 +ccflags-y += -Wall -Wstrict-prototypes -Wno-trigraphs
30 +ccflags-y += -Werror
31 +ccflags-y += -Idrivers/misc/vc04_services
32 +ccflags-y += -Idrivers/misc/vc04_services/interface/vchi
33 +ccflags-y += -Idrivers/misc/vc04_services/interface/vchiq_arm
34  
35 -EXTRA_CFLAGS  += -D__KERNEL__
36 -EXTRA_CFLAGS  += -D__linux__
37 -EXTRA_CFLAGS  += -Werror
38 +ccflags-y += -D__KERNEL__
39 +ccflags-y += -D__linux__
40 +ccflags-y += -Werror
41  
42  obj-$(CONFIG_BCM_VC_CMA) += vc-cma.o
43  
44 --- a/drivers/misc/vc04_services/Makefile
45 +++ b/drivers/misc/vc04_services/Makefile
46 @@ -12,7 +12,7 @@ vchiq-objs := \
47     interface/vchiq_arm/vchiq_util.o \
48     interface/vchiq_arm/vchiq_connected.o \
49  
50 -EXTRA_CFLAGS += -DVCOS_VERIFY_BKPTS=1 -Idrivers/misc/vc04_services -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000
51 +ccflags-y += -DVCOS_VERIFY_BKPTS=1 -Idrivers/misc/vc04_services -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000
52  
53  endif
54  
55 --- a/drivers/usb/host/dwc_common_port/Makefile
56 +++ b/drivers/usb/host/dwc_common_port/Makefile
57 @@ -4,16 +4,16 @@
58  
59  ifneq ($(KERNELRELEASE),)
60  
61 -EXTRA_CFLAGS   += -DDWC_LINUX
62 -#EXTRA_CFLAGS  += -DDEBUG
63 -#EXTRA_CFLAGS  += -DDWC_DEBUG_REGS
64 -#EXTRA_CFLAGS  += -DDWC_DEBUG_MEMORY
65 -
66 -EXTRA_CFLAGS   += -DDWC_LIBMODULE
67 -EXTRA_CFLAGS   += -DDWC_CCLIB
68 -#EXTRA_CFLAGS  += -DDWC_CRYPTOLIB
69 -EXTRA_CFLAGS   += -DDWC_NOTIFYLIB
70 -EXTRA_CFLAGS   += -DDWC_UTFLIB
71 +ccflags-y      += -DDWC_LINUX
72 +#ccflags-y     += -DDEBUG
73 +#ccflags-y     += -DDWC_DEBUG_REGS
74 +#ccflags-y     += -DDWC_DEBUG_MEMORY
75 +
76 +ccflags-y      += -DDWC_LIBMODULE
77 +ccflags-y      += -DDWC_CCLIB
78 +#ccflags-y     += -DDWC_CRYPTOLIB
79 +ccflags-y      += -DDWC_NOTIFYLIB
80 +ccflags-y      += -DDWC_UTFLIB
81  
82  obj-$(CONFIG_USB_DWCOTG)       += dwc_common_port_lib.o
83  dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
84 @@ -24,8 +24,8 @@ kernrelwd := $(subst ., ,$(KERNELRELEASE
85  kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd))
86                             
87  ifneq ($(kernrel3),2.6.20)
88 -# grayg - I only know that we use EXTRA_CFLAGS in 2.6.31 actually
89 -EXTRA_CFLAGS += $(CPPFLAGS)
90 +# grayg - I only know that we use ccflags-y in 2.6.31 actually
91 +ccflags-y += $(CPPFLAGS)
92  endif
93  
94  else
95 --- a/drivers/usb/host/dwc_common_port/Makefile.linux
96 +++ b/drivers/usb/host/dwc_common_port/Makefile.linux
97 @@ -3,16 +3,16 @@
98  #
99  ifneq ($(KERNELRELEASE),)
100  
101 -EXTRA_CFLAGS   += -DDWC_LINUX
102 -#EXTRA_CFLAGS  += -DDEBUG
103 -#EXTRA_CFLAGS  += -DDWC_DEBUG_REGS
104 -#EXTRA_CFLAGS  += -DDWC_DEBUG_MEMORY
105 +ccflags-y      += -DDWC_LINUX
106 +#ccflags-y     += -DDEBUG
107 +#ccflags-y     += -DDWC_DEBUG_REGS
108 +#ccflags-y     += -DDWC_DEBUG_MEMORY
109  
110 -EXTRA_CFLAGS   += -DDWC_LIBMODULE
111 -EXTRA_CFLAGS   += -DDWC_CCLIB
112 -EXTRA_CFLAGS   += -DDWC_CRYPTOLIB
113 -EXTRA_CFLAGS   += -DDWC_NOTIFYLIB
114 -EXTRA_CFLAGS   += -DDWC_UTFLIB
115 +ccflags-y      += -DDWC_LIBMODULE
116 +ccflags-y      += -DDWC_CCLIB
117 +ccflags-y      += -DDWC_CRYPTOLIB
118 +ccflags-y      += -DDWC_NOTIFYLIB
119 +ccflags-y      += -DDWC_UTFLIB
120  
121  obj-m                   := dwc_common_port_lib.o
122  dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
123 --- a/drivers/usb/host/dwc_otg/Makefile
124 +++ b/drivers/usb/host/dwc_otg/Makefile
125 @@ -12,22 +12,22 @@ ifeq ($(BUS_INTERFACE),)
126          BUS_INTERFACE = -DPLATFORM_INTERFACE
127  endif
128  
129 -#EXTRA_CFLAGS  += -DDEBUG
130 -#EXTRA_CFLAGS  += -DDWC_OTG_DEBUGLEV=1 # reduce common debug msgs
131 +#ccflags-y     += -DDEBUG
132 +#ccflags-y     += -DDWC_OTG_DEBUGLEV=1 # reduce common debug msgs
133  
134  # Use one of the following flags to compile the software in host-only or
135  # device-only mode.
136 -#EXTRA_CFLAGS        += -DDWC_HOST_ONLY
137 -#EXTRA_CFLAGS        += -DDWC_DEVICE_ONLY
138 +#ccflags-y        += -DDWC_HOST_ONLY
139 +#ccflags-y        += -DDWC_DEVICE_ONLY
140  
141 -EXTRA_CFLAGS   += -Dlinux -DDWC_HS_ELECT_TST
142 -#EXTRA_CFLAGS  += -DDWC_EN_ISOC
143 -EXTRA_CFLAGS           += -I$(obj)/../dwc_common_port
144 -#EXTRA_CFLAGS          += -I$(PORTLIB)
145 -EXTRA_CFLAGS           += -DDWC_LINUX
146 -EXTRA_CFLAGS           += $(CFI)
147 -EXTRA_CFLAGS   += $(BUS_INTERFACE)
148 -#EXTRA_CFLAGS  += -DDWC_DEV_SRPCAP
149 +ccflags-y      += -Dlinux -DDWC_HS_ELECT_TST
150 +#ccflags-y     += -DDWC_EN_ISOC
151 +ccflags-y      += -I$(obj)/../dwc_common_port
152 +#ccflags-y     += -I$(PORTLIB)
153 +ccflags-y      += -DDWC_LINUX
154 +ccflags-y      += $(CFI)
155 +ccflags-y      += $(BUS_INTERFACE)
156 +#ccflags-y     += -DDWC_DEV_SRPCAP
157  
158  obj-$(CONFIG_USB_DWCOTG) += dwc_otg.o
159  
160 @@ -45,7 +45,7 @@ kernrelwd := $(subst ., ,$(KERNELRELEASE
161  kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd))
162  
163  ifneq ($(kernrel3),2.6.20)
164 -EXTRA_CFLAGS += $(CPPFLAGS)
165 +ccflags-y += $(CPPFLAGS)
166  endif
167  
168  else
169 --- a/sound/arm/Makefile
170 +++ b/sound/arm/Makefile
171 @@ -18,5 +18,5 @@ snd-pxa2xx-ac97-objs          := pxa2xx-ac97.o
172  obj-$(CONFIG_SND_BCM2835)      += snd-bcm2835.o
173  snd-bcm2835-objs               := bcm2835.o bcm2835-ctl.o bcm2835-pcm.o bcm2835-vchiq.o
174  
175 -EXTRA_CFLAGS += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000
176 +ccflags-y += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000
177