coolsnowwolf-lede/Makefile

144 lines
4.1 KiB
Makefile
Raw Normal View History

# SPDX-License-Identifier: GPL-2.0-only
2017-09-06 19:19:45 +08:00
#
# Copyright (C) 2007 OpenWrt.org
TOPDIR:=${CURDIR}
LC_ALL:=C
LANG:=C
TZ:=UTC
export TOPDIR LC_ALL LANG TZ
empty:=
space:= $(empty) $(empty)
2024-11-14 13:14:47 +08:00
$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the LEDE directory must not include any spaces))
2017-09-06 19:19:45 +08:00
world:
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep -e '/usr' -e '/nix/store' -m 1)
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
treewide: sync with upstream (#10750) * build: fix incomplete initramfs compression options Requires: tools/lz4, tools/lzop complete the wiring so that these options work: * `CONFIG_KERNEL_INITRAMFS_COMPRESSION_LZO` * `CONFIG_KERNEL_INITRAMFS_COMPRESSION_LZ4` Signed-off-by: Tony Butler <spudz76@gmail.com> [remove blocking dependencies for separate ramdisk, fix lzop options] Signed-off-by: Daniel Golle <daniel@makrotopia.org> * include: sync with upstream * toolchain/binutils: add support for version 2.40 Release notes: https://sourceware.org/pipermail/binutils/2023-January/125671.html Signed-off-by: Linhui Liu <liulinhui36@gmail.com> * toolchain/gcc: switch to version 12 by default Also fix build error with gcc 12. * toolchain/nasm: update to 2.16.01 ChangeLog: Version 2.16.01 _This is a documentation update release only._ (*) Fix the creation of the table of contents in the HTML version of the documentation. Version 2.16 (*) Support for the `rdf' format has been discontinued and all the RDOFF utilities has been removed. (*) The `--reproducible' option now leaves the filename field in the COFF object format blank. This was always rather useless since it is only 18 characters long; as such debug formats have to carry their own filename information anyway. (*) Fix handling of MASM-syntax reserved memory (e.g. `dw ?') when used in structure definitions. (*) The preprocessor now supports functions, which can be less verbose and more convenient than the equivalent code implemented using directives. See section 4.4. (*) Fix the handling of `%00' in the preprocessor. (*) Fix incorrect handling of path names affecting error messages, dependency generation, and debug format output. (*) Support for the RDOFF output format and the RDOFF tools have been removed. The RDOFF tools had already been broken since at least NASM 2.14. For flat code the ELF output format recommended; for segmented code the `obj' (OMF) output format. (*) New facility: preprocessor functions. Preprocessor functions, which are expanded similarly to single-line macros, can greatly simplify code that in the past would have required a lengthy list of directives and intermediate macros. See section 4.4. (*) Single-line macros can now declare parameters (using a `&&' prefix) that creates a quoted string, but does _not_ requote an already quoted string. See section 4.2.1. (*) Instruction table updated per public information available as of November 2022. (*) All warnings in the preprocessor have now been assigned warning classes. See appendix A. (*) Fix the invalid use of `RELA'-type relocations instead of `REL'- type relocations when generating DWARF debug information for the `elf32' output format. (*) Fix the handling `at' in `istruc' when the structure contains local labels. See section 5.9.2. (*) When assembling with `--reproducible', don't encode the filename in the COFF header for the `coff', `win32' or `win64' output formats. The COFF header only has space for an 18-character filename, which makes this field rather useless in the first place. Debug output data, if enabled, is not affected. (*) Fix incorrect size calculation when using MASM syntax for non- byte reservations (e.g. `dw ?'.) (*) Allow forcing an instruction in 64-bit mode to have a (possibly redundant) REX prefix, using the syntax `{rex}' as a prefix. (*) Add a `{vex}' prefix to enforce VEX (AVX) encoding of an instruction, either using the 2- or 3-byte VEX prefixes. (*) The `CPU' directive has been augmented to allow control of generation of VEX (AVX) versus EVEX (AVX-512) instruction formats, see section 7.11. (*) Some recent instructions that previously have been only available using EVEX encodings are now also encodable using VEX (AVX) encodings. For backwards compatibility these encodings are not enabled by default, but can be generated either via an explicit `{vex}' prefix or by specifying either `CPU LATEVEX' or `CPU NOEVEX'; see section 7.11. (*) Document the already existing `%unimacro' directive. See section 4.5.12. (*) Fix a code range generation bug in the DWARF debug format (incorrect information in the `DW_AT_high_pc' field) for the ELF output formats. This bug happened to cancel out with a bug in older versions of the GNU binutils linker, but breaks with other linkers and updated or other linkers that expect the spec to be followed. (*) Fix segment symbols with addends, e.g. `jmp _TEXT+10h:0' in output formats that support segment relocations, e.g. the `obj' format. (*) Fix various crashes and hangs on invalid input. Signed-off-by: Linhui Liu <liulinhui36@gmail.com> * toolchain: musl: Fix symbol loading in gdb Fix DT_DEBUG handling on MIPS in musl libc. With this change gdb will load the symbol files for shared libraries on MIPS too. This patch was taken from this thread: https://www.openwall.com/lists/musl/2022/01/09/4 Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com> * tools: sync with upstream * build: fix issues with targets installed via feeds - fix including modules.mk when a target is being replaced - fix calling make targets from target/linux Signed-off-by: Felix Fietkau <nbd@nbd.name> * package: sync with upstream Signed-off-by: Tony Butler <spudz76@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Linhui Liu <liulinhui36@gmail.com> Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> Co-authored-by: Tony Butler <spudz76@gmail.com> Co-authored-by: Hauke Mehrtens <hmehrtens@maxlinear.com> Co-authored-by: Felix Fietkau <nbd@nbd.name>
2023-01-25 15:30:35 +08:00
export PATH:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host/bin),$(TOPDIR)/staging_dir/host/bin):$(PATH)
2017-09-06 19:19:45 +08:00
ifneq ($(OPENWRT_BUILD),1)
_SINGLE=export MAKEFLAGS=$(space);
override OPENWRT_BUILD=1
export OPENWRT_BUILD
GREP_OPTIONS=
export GREP_OPTIONS
2018-09-07 13:43:55 +08:00
CDPATH=
export CDPATH
2017-09-06 19:19:45 +08:00
include $(TOPDIR)/include/debug.mk
include $(TOPDIR)/include/depends.mk
include $(TOPDIR)/include/toplevel.mk
else
include rules.mk
include $(INCLUDE_DIR)/depends.mk
include $(INCLUDE_DIR)/subdir.mk
include target/Makefile
include package/Makefile
include tools/Makefile
include toolchain/Makefile
# Include the test suite Makefile if it exists
-include tests/Makefile
2022-10-19 20:39:19 +08:00
$(toolchain/stamp-compile): $(tools/stamp-compile) $(if $(CONFIG_BUILDBOT),toolchain_rebuild_check)
2017-09-06 19:19:45 +08:00
$(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
$(package/stamp-install): $(package/stamp-compile)
$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
check: $(tools/stamp-check) $(toolchain/stamp-check) $(package/stamp-check)
printdb:
@true
prepare: $(target/stamp-compile)
2022-10-19 20:39:19 +08:00
_clean: FORCE
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(TOPDIR)/staging_dir/packages
2017-09-06 19:19:45 +08:00
2022-10-19 20:39:19 +08:00
clean: _clean
rm -rf $(BUILD_LOG_DIR)
targetclean: _clean
rm -rf $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
dirclean: targetclean clean
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(BUILD_DIR_BASE)/host
2017-09-06 19:19:45 +08:00
rm -rf $(TMP_DIR)
2020-07-02 23:30:56 +08:00
$(MAKE) -C $(TOPDIR)/scripts/config clean
2022-10-19 20:39:19 +08:00
toolchain_rebuild_check:
$(SCRIPT_DIR)/check-toolchain-clean.sh
2017-09-06 19:19:45 +08:00
cacheclean:
ifneq ($(CONFIG_CCACHE),)
$(STAGING_DIR_HOST)/bin/ccache -C
endif
2017-09-06 19:19:45 +08:00
ifndef DUMP_TARGET_DB
$(BUILD_DIR)/.prepared: Makefile
@mkdir -p $$(dirname $@)
@touch $@
tmp/.prereq_packages: .config
unset ERROR; \
for package in $(sort $(prereq-y) $(prereq-m)); do \
$(_SINGLE)$(NO_TRACE_MAKE) -s -r -C package/$$package prereq || ERROR=1; \
done; \
if [ -n "$$ERROR" ]; then \
echo "Package prerequisite check failed."; \
false; \
fi
touch $@
endif
# check prerequisites before starting to build
prereq: $(target/stamp-prereq) tmp/.prereq_packages
@if [ ! -f "$(INCLUDE_DIR)/site/$(ARCH)" ]; then \
echo 'ERROR: Missing site config for architecture "$(ARCH)" !'; \
echo ' The missing file will cause configure scripts to fail during compilation.'; \
echo ' Please provide a "$(INCLUDE_DIR)/site/$(ARCH)" file and restart the build.'; \
exit 1; \
fi
2020-07-02 23:30:56 +08:00
$(BIN_DIR)/profiles.json: FORCE
$(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
WORK_DIR=$(BUILD_DIR)/json_info_files \
$(SCRIPT_DIR)/json_overview_image_info.py $@ \
)
json_overview_image_info: $(BIN_DIR)/profiles.json
2017-09-06 19:19:45 +08:00
checksum: FORCE
2018-09-07 13:43:55 +08:00
$(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT))
2017-09-06 19:19:45 +08:00
2020-07-02 23:30:56 +08:00
buildversion: FORCE
$(SCRIPT_DIR)/getver.sh > $(BIN_DIR)/version.buildinfo
feedsversion: FORCE
$(SCRIPT_DIR)/feeds list -fs > $(BIN_DIR)/feeds.buildinfo
2017-09-06 19:19:45 +08:00
diffconfig: FORCE
mkdir -p $(BIN_DIR)
2020-07-02 23:30:56 +08:00
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.buildinfo
buildinfo: FORCE
$(_SINGLE)$(SUBMAKE) -r diffconfig buildversion feedsversion
2017-09-06 19:19:45 +08:00
prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile)
2020-07-02 23:30:56 +08:00
$(_SINGLE)$(SUBMAKE) -r buildinfo
2017-09-06 19:19:45 +08:00
world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
$(_SINGLE)$(SUBMAKE) -r package/index
2020-07-02 23:30:56 +08:00
$(_SINGLE)$(SUBMAKE) -r json_overview_image_info
$(_SINGLE)$(SUBMAKE) -r checksum
ifneq ($(CONFIG_CCACHE),)
$(STAGING_DIR_HOST)/bin/ccache -s
endif
2017-09-06 19:19:45 +08:00
.PHONY: clean dirclean prereq prepare world package/symlinks package/symlinks-install package/symlinks-clean
endif