From 7f239688ba6cad4c861779f75775e10fc7a0ba78 Mon Sep 17 00:00:00 2001 From: Ajay Kumar Nandam Date: Mon, 8 Sep 2025 15:40:46 +0530 Subject: [PATCH] audioreach-kernel: Refactor top-level Makefile for modular build Refactored the top-level Makefile to delegate build, install, and clean operations to subdirectories such as `audioreach-driver`, replacing the previous direct object compilation approach. This change improves maintainability and aligns with a modular build structure. Signed-off-by: Ajay Kumar Nandam --- Makefile | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index b49c57a..0a80287 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,20 @@ -AUDIO_ROOT=$(PWD) +#Top-level Makefile for AudioReach kernel modules -obj-m := ipc/audio-pkt.o -obj-m += dsp/spf-core.o -obj-m += dsp/msm_audio_mem.o +SUBDIRS := audioreach-driver -EXTRA_CFLAGS += -I$(AUDIO_ROOT)/include +.PHONY: all clean modules_install all: - $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules + @for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir all; \ + done modules_install: - $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install + @for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir modules_install; \ + done clean: - find ./ -iname "*.o" -delete - find ./ -iname "*.ko" -delete - find ./ -iname "*.mod.c" -delete - find ./ -iname "*.mod.o" -delete - find ./ -iname "*~" -delete - find ./ -iname ".*.cmd" -delete - rm -f Module.symvers - rm -rf .tmp_versions + @for dir in $(SUBDIRS); do \ + $(MAKE) -C $$dir clean; \ + done