Archived
1
0
Fork 0
This repository has been archived on 2024-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
padavan-luna/patches/fast_compilation.patch
2023-06-10 17:17:16 +03:00

91 lines
4.3 KiB
Diff

diff --git a/trunk/Makefile b/trunk/Makefile
index 28fbbae519..736289696f 100755
--- a/trunk/Makefile
+++ b/trunk/Makefile
@@ -23,44 +23,44 @@ all: tools linux libc_only libs_only user_only romfs image
# Get the core stuff worked out
#
-ROOTDIR = $(shell pwd)
-HOSTCC = gcc
-ROMFSINST = $(ROOTDIR)/tools/romfs-inst.sh
-TFTPDIR = /tftpboot
+ROOTDIR := $(shell pwd)
+HOSTCC := gcc
+ROMFSINST := $(ROOTDIR)/tools/romfs-inst.sh
+TFTPDIR := /tftpboot
PATH := $(PATH):$(ROOTDIR)/tools
-VERSIONSTR = Mediatek/$(CONFIG_PRODUCT) Version $(VERSIONPKG)
+VERSIONSTR := Mediatek/$(CONFIG_PRODUCT) Version $(VERSIONPKG)
-BOARDDIR = $(ROOTDIR)/configs/boards/$(CONFIG_VENDOR)/$(CONFIG_FIRMWARE_PRODUCT_ID)
-LINUXDIR = linux-3.4.x
-LINUXINCDIR = $(ROOTDIR)/$(LINUXDIR)/include
-IMAGEDIR = $(ROOTDIR)/images
-ROMFSDIR = $(ROOTDIR)/romfs
-STAGEDIR = $(ROOTDIR)/stage
-SCRIPTSDIR = $(ROOTDIR)/config/scripts
-LINUX_CONFIG = $(ROOTDIR)/$(LINUXDIR)/.config
-ARCH_CONFIG = $(ROOTDIR)/vendors/config/mips/config.arch
-PROJECT_CONFIG = $(ROOTDIR)/.config
-SSTRIP_TOOL = $(if $(CONFIG_FIRMWARE_PERFORM_SSTRIP),$(ROOTDIR)/tools/sstrip/sstrip)
+BOARDDIR := $(ROOTDIR)/configs/boards/$(CONFIG_VENDOR)/$(CONFIG_FIRMWARE_PRODUCT_ID)
+LINUXDIR := linux-3.4.x
+LINUXINCDIR := $(ROOTDIR)/$(LINUXDIR)/include
+IMAGEDIR := $(ROOTDIR)/images
+ROMFSDIR := $(ROOTDIR)/romfs
+STAGEDIR := $(ROOTDIR)/stage
+SCRIPTSDIR := $(ROOTDIR)/config/scripts
+LINUX_CONFIG := $(ROOTDIR)/$(LINUXDIR)/.config
+ARCH_CONFIG := $(ROOTDIR)/vendors/config/mips/config.arch
+PROJECT_CONFIG := $(ROOTDIR)/.config
+SSTRIP_TOOL := $(if $(CONFIG_FIRMWARE_PERFORM_SSTRIP),$(ROOTDIR)/tools/sstrip/sstrip)
-PKG_CONFIG_SYSROOT_DIR = $(STAGEDIR)
-PKG_CONFIG_LIBDIR = $(PKG_CONFIG_SYSROOT_DIR)/lib
-PKG_CONFIG_PATH = $(PKG_CONFIG_LIBDIR)/pkgconfig
+PKG_CONFIG_SYSROOT_DIR := $(STAGEDIR)
+PKG_CONFIG_LIBDIR := $(PKG_CONFIG_SYSROOT_DIR)/lib
+PKG_CONFIG_PATH := $(PKG_CONFIG_LIBDIR)/pkgconfig
-FIRMWARE_MAXSIZE = $(shell awk '/"Firmware"/{ getline; getline; gsub(/,$$/,""); print strtonum($$2); }' $(BOARDDIR)/partitions.config)
+FIRMWARE_MAXSIZE := $(shell awk '/"Firmware"/{ getline; getline; gsub(/,$$/,""); print strtonum($$2); }' $(BOARDDIR)/partitions.config)
#NUM MAKE PROCESS = CPU NUMBER IN THE SYSTEM * CPU_OVERLOAD
-CPU_OVERLOAD = 1
-HOST_NCPU = $(shell if [ -f /proc/cpuinfo ]; then n=`getconf _NPROCESSORS_ONLN 2>/dev/null || echo 0`; if [ $$n -gt 1 ];then expr $$n \* ${CPU_OVERLOAD}; else echo $$n; fi; else echo 1; fi)
+CPU_OVERLOAD := 1
+HOST_NCPU := $(shell if [ -f /proc/cpuinfo ]; then n=`getconf _NPROCESSORS_ONLN 2>/dev/null || echo 0`; if [ $$n -gt 1 ];then expr $$n \* ${CPU_OVERLOAD}; else echo $$n; fi; else echo 1; fi)
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
-FIRMWARE_KERNEL_VER="3.4"
-CONFIG_CROSS_COMPILER_ROOT = ${CONFIG_TOOLCHAIN_DIR}
-CONFIG_CROSS_COMPILER_PATH = $(CONFIG_CROSS_COMPILER_ROOT)/bin
-KERNEL_HEADERS_PATH = $(CONFIG_CROSS_COMPILER_ROOT)/mipsel-linux-uclibc/sysroot/usr/include
+FIRMWARE_KERNEL_VE:=="3.4"
+CONFIG_CROSS_COMPILER_ROOT := ${CONFIG_TOOLCHAIN_DIR}
+CONFIG_CROSS_COMPILER_PATH := $(CONFIG_CROSS_COMPILER_ROOT)/bin
+KERNEL_HEADERS_PATH := $(CONFIG_CROSS_COMPILER_ROOT)/mipsel-linux-uclibc/sysroot/usr/include
include $(ARCH_CONFIG)
@@ -68,11 +68,11 @@ include $(ARCH_CONFIG)
KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE)
ifneq ($(SUBARCH),)
# Using UML, so make the kernel and non-kernel with different ARCHs
-MAKEARCH = $(MAKE) ARCH=$(SUBARCH) CROSS_COMPILE=$(CROSS_COMPILE)
-MAKEARCH_KERNEL = $(MAKE) ARCH=$(ARCH) SUBARCH=$(SUBARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE)
+MAKEARCH := $(MAKE) -j$(HOST_NCPU) ARCH=$(SUBARCH) CROSS_COMPILE=$(CROSS_COMPILE)
+MAKEARCH_KERNEL := $(MAKE) -j$(HOST_NCPU) ARCH=$(ARCH) SUBARCH=$(SUBARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE)
else
-MAKEARCH = $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)
-MAKEARCH_KERNEL = $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE)
+MAKEARCH := $(MAKE) -j$(HOST_NCPU) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)
+MAKEARCH_KERNEL := $(MAKE) -j$(HOST_NCPU) ARCH=$(ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE)
endif
DIRS = libc libs user