diff mbox series

[RFC,v2,04/96] cl8k: add Makefile

Message ID 20220524113502.1094459-5-viktor.barna@celeno.com (mailing list archive)
State RFC
Delegated to: Kalle Valo
Headers show
Series wireless: cl8k driver for Celeno IEEE 802.11ax devices | expand

Commit Message

Viktor Barna May 24, 2022, 11:33 a.m. UTC
From: Viktor Barna <viktor.barna@celeno.com>

(Part of the split. Please, take a look at the cover letter for more
details).

Signed-off-by: Viktor Barna <viktor.barna@celeno.com>
---
 drivers/net/wireless/celeno/cl8k/Makefile | 66 +++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 drivers/net/wireless/celeno/cl8k/Makefile

Comments

Johannes Berg May 26, 2022, 6:24 p.m. UTC | #1
On Tue, 2022-05-24 at 14:33 +0300, viktor.barna@celeno.com wrote:
> 
> +ccflags-y += -I$(src) -I$(srctree)/net/wireless -I$(srctree)/net/mac80211/
> +ccflags-y += -I$(src) -Werror

Neither of these should be here. *Maybe* -I$(src), but that's probably
not even needed.

> +
> +define cc_ver_cmp
> +$(shell [ "$$($(CC) -dumpversion | cut -d. -f1)" -$(1) "$(2)" ] && echo "true" || echo "false")
> +endef
> +
> +ifeq ($(call cc_ver_cmp,ge,8),true)
> +ccflags-y += -Wno-error=stringop-truncation
> +ccflags-y += -Wno-error=format-truncation
> +endif
> +
> +# Stop these C90 warnings. We use C99.
> +ccflags-y += -Wno-declaration-after-statement -g

No no, all of that needs to go, don't make up your own stuff here.

johannes
Kalle Valo July 13, 2022, 7:39 a.m. UTC | #2
viktor.barna@celeno.com writes:

> +cl-objs += \
> +	wrs.o \
> +	phy.o \
> +	key.o \
> +	sta.o \
> +	hw.o \
> +	chip.o \
> +	fw.o \
> +	utils.o \
> +	channel.o \
> +	rx.o \
> +	tx.o \
> +	main.o \
> +	mac_addr.o \
> +	ampdu.o \
> +	dfs.o \
> +	enhanced_tim.o \
> +	e2p.o \
> +	calib.o \
> +	stats.o \
> +	power.o \
> +	motion_sense.o \
> +	bf.o \
> +	sounding.o \
> +	debug.o \
> +	temperature.o \
> +	recovery.o \
> +	rates.o \
> +	radio.o \
> +	config.o \
> +	tcv.o \
> +	traffic.o \
> +	vns.o \
> +	maintenance.o \
> +	ela.o \
> +	rfic.o \
> +	vif.o \
> +	dsp.o \
> +	pci.o \
> +	version.o \
> +	regdom.o \
> +	mac80211.o \
> +	platform.o \
> +	scan.o
> +
> +ifneq ($(CONFIG_CL8K),)
> +cl8k-y += $(cl-objs)
> +endif

I don't understand why you need ifneq here. Please check how are other
drivers (like iwlwifi) do it, Makefile can be really simple
diff mbox series

Patch

diff --git a/drivers/net/wireless/celeno/cl8k/Makefile b/drivers/net/wireless/celeno/cl8k/Makefile
new file mode 100644
index 000000000000..9ff98cda5261
--- /dev/null
+++ b/drivers/net/wireless/celeno/cl8k/Makefile
@@ -0,0 +1,66 @@ 
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+obj-$(CONFIG_CL8K) += cl8k.o
+
+ccflags-y += -I$(src) -I$(srctree)/net/wireless -I$(srctree)/net/mac80211/
+ccflags-y += -I$(src) -Werror
+
+define cc_ver_cmp
+$(shell [ "$$($(CC) -dumpversion | cut -d. -f1)" -$(1) "$(2)" ] && echo "true" || echo "false")
+endef
+
+ifeq ($(call cc_ver_cmp,ge,8),true)
+ccflags-y += -Wno-error=stringop-truncation
+ccflags-y += -Wno-error=format-truncation
+endif
+
+# Stop these C90 warnings. We use C99.
+ccflags-y += -Wno-declaration-after-statement -g
+
+cl-objs += \
+	wrs.o \
+	phy.o \
+	key.o \
+	sta.o \
+	hw.o \
+	chip.o \
+	fw.o \
+	utils.o \
+	channel.o \
+	rx.o \
+	tx.o \
+	main.o \
+	mac_addr.o \
+	ampdu.o \
+	dfs.o \
+	enhanced_tim.o \
+	e2p.o \
+	calib.o \
+	stats.o \
+	power.o \
+	motion_sense.o \
+	bf.o \
+	sounding.o \
+	debug.o \
+	temperature.o \
+	recovery.o \
+	rates.o \
+	radio.o \
+	config.o \
+	tcv.o \
+	traffic.o \
+	vns.o \
+	maintenance.o \
+	ela.o \
+	rfic.o \
+	vif.o \
+	dsp.o \
+	pci.o \
+	version.o \
+	regdom.o \
+	mac80211.o \
+	platform.o \
+	scan.o
+
+ifneq ($(CONFIG_CL8K),)
+cl8k-y += $(cl-objs)
+endif