[PATCH 02/20] package/lantiq: use make -C instead of `cd;`

Elliott Mitchell ehem+openwrt at m5p.com
Mon Nov 13 14:38:31 PST 2023


The effect is the same, but this reduces work by the shell.  This
is generally preferred unless multiple commands need to be run in the
target directory.

Signed-off-by: Elliott Mitchell <ehem+openwrt at m5p.com>
---
 package/kernel/lantiq/ltq-adsl-mei/Makefile | 5 ++---
 package/kernel/lantiq/ltq-atm/Makefile      | 5 ++---
 package/kernel/lantiq/ltq-deu/Makefile      | 5 ++---
 package/kernel/lantiq/ltq-ptm/Makefile      | 5 ++---
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/package/kernel/lantiq/ltq-adsl-mei/Makefile b/package/kernel/lantiq/ltq-adsl-mei/Makefile
index 31e671e53f..e9db785960 100644
--- a/package/kernel/lantiq/ltq-adsl-mei/Makefile
+++ b/package/kernel/lantiq/ltq-adsl-mei/Makefile
@@ -34,9 +34,8 @@ define Build/Configure
 endef
 
 define Build/Compile
-	cd $(LINUX_DIR); \
-		ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
-		$(MAKE) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR)/ V=1 modules
+	ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
+	$(MAKE) -C $(LINUX_DIR) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR)/ V=1 modules
 endef
 
 $(eval $(call KernelPackage,ltq-adsl-danube-mei))
diff --git a/package/kernel/lantiq/ltq-atm/Makefile b/package/kernel/lantiq/ltq-atm/Makefile
index b81f3bb293..af852e9a01 100644
--- a/package/kernel/lantiq/ltq-atm/Makefile
+++ b/package/kernel/lantiq/ltq-atm/Makefile
@@ -39,9 +39,8 @@ define Build/Configure
 endef
 
 define Build/Compile
-	cd $(LINUX_DIR); \
-		ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
-		$(MAKE) $(KERNEL_MAKE_FLAGS) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR) V=1 modules
+	ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
+	$(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR) V=1 modules
 endef
 
 $(eval $(call KernelPackage,ltq-atm-danube))
diff --git a/package/kernel/lantiq/ltq-deu/Makefile b/package/kernel/lantiq/ltq-deu/Makefile
index 4e8127afab..4b8fae2766 100644
--- a/package/kernel/lantiq/ltq-deu/Makefile
+++ b/package/kernel/lantiq/ltq-deu/Makefile
@@ -34,9 +34,8 @@ define Build/Configure
 endef
 
 define Build/Compile
-	cd $(LINUX_DIR); \
-		ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
-		$(MAKE) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR) V=1 modules
+	ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
+	$(MAKE) -C $(LINUX_DIR) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR) V=1 modules
 endef
 
 $(eval $(call KernelPackage,ltq-deu-danube))
diff --git a/package/kernel/lantiq/ltq-ptm/Makefile b/package/kernel/lantiq/ltq-ptm/Makefile
index b726cb1560..a1fb2250d2 100644
--- a/package/kernel/lantiq/ltq-ptm/Makefile
+++ b/package/kernel/lantiq/ltq-ptm/Makefile
@@ -43,9 +43,8 @@ define Build/Configure
 endef
 
 define Build/Compile
-	cd $(LINUX_DIR); \
-		ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
-		$(MAKE) $(KERNEL_MAKE_FLAGS) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR) V=1 modules
+	ARCH=mips CROSS_COMPILE="$(KERNEL_CROSS)" \
+	$(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS) BUILD_VARIANT=$(BUILD_VARIANT) M=$(PKG_BUILD_DIR) V=1 modules
 endef
 
 $(eval $(call KernelPackage,ltq-ptm-danube))
-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |       ehem+openwrt at m5p.com     PGP 87145445       |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445






More information about the openwrt-devel mailing list