# Cleanup environment from any variables
unexport BUILD_ARCH BUILD_PLATFORM BUILDTARGET CROSSTARGET TOOLCHAIN TOOLS_DIR
+unexport XZ_OPT
+
+PARALLELISM = $(shell echo $$( \
+ if [ -n "$(MAX_PARALLELISM)" ] && [ $(MAX_PARALLELISM) -lt $(DEFAULT_PARALLELISM) ]; then \
+ echo $(MAX_PARALLELISM); \
+ else \
+ echo $(DEFAULT_PARALLELISM); \
+ fi) \
+)
+
+MAKETUNING = -j$(PARALLELISM)
ifeq "$(BUILD_ARCH)" "aarch64"
IS_64BIT = 1
endif
+ifeq "$(BUILD_ARCH)" "armv7hl"
+ IS_32BIT = 1
+endif
+
+ifeq "$(BUILD_ARCH)" "armv5tel"
+ IS_32BIT = 1
+endif
+
ifeq "$(BUILD_ARCH)" "x86_64"
IS_64BIT = 1
endif
+ifeq "$(BUILD_ARCH)" "i586"
+ IS_32BIT = 1
+endif
+
ifeq "$(TOOLCHAIN)" "1"
PREFIX = $(TOOLS_DIR)
else
# Add the compiler location and version and specs to the ccache hash
CCACHE_COMPILERCHECK += $(shell gcc -dumpspecs 2>/dev/null | md5sum | cut -d ' ' -f1)
-# We support EFI on x86_64
+# We support EFI on x86_64 and aarch64
ifeq "$(BUILD_ARCH)" "x86_64"
EFI = 1
EFI_ARCH = x64
+ GRUB_ARCH = $(BUILD_ARCH)
endif
-# Basic modules
-GRUB_EFI_MODULES = \
- configfile \
- efi_gop \
- efi_uga \
- gzio \
- linux \
- loadbios \
- loadenv \
- normal \
- regexp
-
-# Stuff for accessing file systems
-GRUB_EFI_MODULES += \
- ahci \
- ext2 \
- fat \
- iso9660 \
- part_gpt \
- part_msdos \
- udf
-
-# Graphics & IO
-GRUB_EFI_MODULES += \
- all_video \
- at_keyboard \
- bitmap_scale \
- font \
- gfxmenu \
- gfxterm \
- jpeg \
- png \
- tga \
- usb_keyboard
-
-# Commands
-GRUB_EFI_MODULES += \
- boot \
- cat \
- chain \
- echo \
- halt \
- help \
- ls \
- minicmd \
- probe \
- reboot \
- search \
- search_fs_file \
- search_fs_uuid \
- search_label \
- test \
- true
+ifeq "$(BUILD_ARCH)" "aarch64"
+ EFI = 1
+ EFI_ARCH = aa64
+ GRUB_ARCH = arm64
+endif
###############################################################################
# Common Macro Definitions
cd $(ROOT)/ && find -mount \
\( -path '.$(TOOLS_DIR)' -or -path './tmp' -or -path './usr/src' \
-or -path './run' -or -path './dev' -or -path './proc' \
- -or -path './install' \) -prune -or -print | sort
+ -or -path './install' -or -path '.*/__pycache__' \) -prune -or -print | sort
endef
# This is common starting logic for builds.
sed -e 's/BUILDTARGET/$(BUILDTARGET)/g' -e 's/KVER/$(KVER)/g' -e 's/MACHINE/$(BUILD_ARCH)/g' -i /install/packages/package/ROOTFILES
sed -e 's/xxxKVERxxx/$(KVER)/g' -i /install/packages/package/install.sh
chmod 755 /install/packages/package/{{,un}install,update}.sh
- cd / && tar cfp /install/packages/package/files.tmp --numeric-owner --exclude='#*' --files-from=/install/packages/package/ROOTFILES
+ cd / && tar cfp /install/packages/package/files.tmp --numeric-owner --exclude='#*' --exclude='__pycache__' --files-from=/install/packages/package/ROOTFILES
# Double tar to remove double files
tar xfp /install/packages/package/files.tmp --numeric-owner -C /install/packages/package/tmp/
rm -f /install/packages/package/files.tmp