2019-12-09 12:57:37 +01:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
.SUFFIXES:
|
|
|
|
#---------------------------------------------------------------------------------
|
2019-12-31 11:46:01 +01:00
|
|
|
DIR_WILDCARD=$(foreach d,$(wildcard $(1:=/*)),$(if $(wildcard $d/.),$(call DIR_WILDCARD,$d) $d,))
|
2019-12-09 12:57:37 +01:00
|
|
|
|
|
|
|
export ATMOSPHERE_CONFIG_MAKE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
export ATMOSPHERE_LIBRARIES_DIR := $(ATMOSPHERE_CONFIG_MAKE_DIR)/..
|
|
|
|
|
|
|
|
ifeq ($(strip $(ATMOSPHERE_BOARD)),)
|
|
|
|
export ATMOSPHERE_BOARD := nx-hac-001
|
|
|
|
|
2019-12-17 09:37:55 +01:00
|
|
|
ifeq ($(strip $(ATMOSPHERE_CPU)),)
|
2020-08-11 20:43:34 +02:00
|
|
|
export ATMOSPHERE_CPU := arm-cortex-a57
|
2019-12-17 09:37:55 +01:00
|
|
|
endif
|
|
|
|
|
2020-05-05 08:33:16 +02:00
|
|
|
endif
|
|
|
|
|
2022-03-06 21:08:20 +01:00
|
|
|
ifeq ($(ATMOSPHERE_BUILD_NAME),)
|
|
|
|
export ATMOSPHERE_BUILD_NAME := release
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(ATMOSPHERE_COMPILER_NAME)),)
|
|
|
|
|
|
|
|
ifneq ($(strip $(ATMOSPHERE_BOARD)),generic_macos)
|
|
|
|
export ATMOSPHERE_COMPILER_NAME := gcc
|
|
|
|
else
|
|
|
|
export ATMOSPHERE_COMPILER_NAME := clang
|
|
|
|
endif
|
|
|
|
|
|
|
|
export ATMOSPHERE_BUILD_NAME := release
|
|
|
|
endif
|
|
|
|
|
2020-10-27 21:55:19 +01:00
|
|
|
ATMOSPHERE_BUILD_SETTINGS ?=
|
|
|
|
|
2019-12-09 12:57:37 +01:00
|
|
|
export ATMOSPHERE_DEFINES := -DATMOSPHERE
|
2022-02-14 23:58:43 +01:00
|
|
|
export ATMOSPHERE_SETTINGS := -fPIE -g $(ATMOSPHERE_BUILD_SETTINGS)
|
2020-06-26 02:32:22 +02:00
|
|
|
export ATMOSPHERE_CFLAGS := -Wall -ffunction-sections -fdata-sections -fno-strict-aliasing -fwrapv \
|
|
|
|
-fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector \
|
2022-03-06 21:08:20 +01:00
|
|
|
-Wno-format-zero-length
|
2020-06-26 02:32:22 +02:00
|
|
|
|
2022-03-06 21:08:20 +01:00
|
|
|
ifeq ($(strip $(ATMOSPHERE_COMPILER_NAME)),gcc)
|
|
|
|
export ATMOSPHERE_CFLAGS += -Wno-stringop-truncation -Wno-format-truncation
|
|
|
|
else ifeq ($(strip $(ATMOSPHERE_COMPILER_NAME)),clang)
|
|
|
|
export ATMOSPHERE_CFLAGS += -Wno-c99-designator -Wno-gnu-alignof-expression -Wno-unused-private-field
|
|
|
|
endif
|
2021-10-18 22:10:02 +02:00
|
|
|
|
|
|
|
export ATMOSPHERE_CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++20 -Wno-invalid-offsetof
|
2019-12-09 12:57:37 +01:00
|
|
|
export ATMOSPHERE_ASFLAGS :=
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(ATMOSPHERE_BOARD),nx-hac-001)
|
2020-05-05 08:33:16 +02:00
|
|
|
|
|
|
|
ifeq ($(ATMOSPHERE_CPU),arm-cortex-a57)
|
2020-08-11 20:22:56 +02:00
|
|
|
export ATMOSPHERE_ARCH_DIR := arm64
|
|
|
|
export ATMOSPHERE_BOARD_DIR := nintendo/nx
|
|
|
|
export ATMOSPHERE_OS_DIR := horizon
|
2019-12-09 12:57:37 +01:00
|
|
|
|
|
|
|
export ATMOSPHERE_ARCH_NAME := arm64
|
2020-02-15 04:58:57 +01:00
|
|
|
export ATMOSPHERE_BOARD_NAME := nintendo_nx
|
2019-12-09 12:57:37 +01:00
|
|
|
export ATMOSPHERE_OS_NAME := horizon
|
2020-08-11 20:43:34 +02:00
|
|
|
|
2022-03-06 21:08:20 +01:00
|
|
|
export ATMOSPHERE_SUB_ARCH_DIR := armv8a
|
|
|
|
export ATMOSPHERE_SUB_ARCH_NAME := armv8a
|
2021-10-31 19:18:17 +01:00
|
|
|
|
2020-08-11 20:43:34 +02:00
|
|
|
export ATMOSPHERE_CPU_EXTENSIONS := arm_crypto_extension aarch64_crypto_extension
|
2022-03-06 21:08:20 +01:00
|
|
|
|
|
|
|
export ATMOSPHERE_BOOT_CPU := arm7tdmi
|
|
|
|
export ATMOSPHERE_BOOT_ARCH_NAME := arm
|
|
|
|
export ATMOSPHERE_BOOT_BOARD_NAME := nintendo_nx
|
|
|
|
export ATMOSPHERE_BOOT_OS_NAME := horizon
|
|
|
|
export ATMOSPHERE_BOOT_SUB_ARCH_NAME := armv4t
|
2020-05-05 08:33:16 +02:00
|
|
|
else ifeq ($(ATMOSPHERE_CPU),arm7tdmi)
|
2020-08-11 20:22:56 +02:00
|
|
|
export ATMOSPHERE_ARCH_DIR := arm
|
|
|
|
export ATMOSPHERE_BOARD_DIR := nintendo/nx_bpmp
|
|
|
|
export ATMOSPHERE_OS_DIR := horizon
|
2020-05-05 08:33:16 +02:00
|
|
|
|
|
|
|
export ATMOSPHERE_ARCH_NAME := arm
|
2021-10-18 20:10:25 +02:00
|
|
|
export ATMOSPHERE_BOARD_NAME := nintendo_nx
|
2020-05-05 08:33:16 +02:00
|
|
|
export ATMOSPHERE_OS_NAME := horizon
|
2020-08-11 20:43:34 +02:00
|
|
|
|
2022-03-06 21:08:20 +01:00
|
|
|
export ATMOSPHERE_SUB_ARCH_DIR := armv4t
|
|
|
|
export ATMOSPHERE_SUB_ARCH_NAME := armv4t
|
2021-10-31 19:18:17 +01:00
|
|
|
|
2020-08-11 20:43:34 +02:00
|
|
|
export ATMOSPHERE_CPU_EXTENSIONS :=
|
2020-05-05 08:33:16 +02:00
|
|
|
endif
|
|
|
|
|
2022-03-06 21:08:20 +01:00
|
|
|
export ATMOSPHERE_LIBDIRS :=
|
|
|
|
|
2021-10-21 05:53:42 +02:00
|
|
|
else ifeq ($(ATMOSPHERE_BOARD),qemu-virt)
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(ATMOSPHERE_CPU),arm-cortex-a57)
|
|
|
|
export ATMOSPHERE_ARCH_DIR := arm64
|
|
|
|
export ATMOSPHERE_BOARD_DIR := qemu/virt
|
|
|
|
export ATMOSPHERE_OS_DIR := horizon
|
|
|
|
|
|
|
|
export ATMOSPHERE_ARCH_NAME := arm64
|
|
|
|
export ATMOSPHERE_BOARD_NAME := qemu_virt
|
|
|
|
export ATMOSPHERE_OS_NAME := horizon
|
|
|
|
|
2021-10-31 19:18:17 +01:00
|
|
|
export ATMOSPHERE_SUB_ARCH_DIR = armv8a
|
|
|
|
export ATMOSPHERE_SUB_ARCH_NAME = armv8a
|
|
|
|
|
2021-10-21 05:53:42 +02:00
|
|
|
export ATMOSPHERE_CPU_EXTENSIONS := arm_crypto_extension aarch64_crypto_extension
|
|
|
|
endif
|
|
|
|
|
2022-03-06 21:08:20 +01:00
|
|
|
export ATMOSPHERE_LIBDIRS :=
|
|
|
|
|
|
|
|
else ifeq ($(ATMOSPHERE_BOARD),generic_windows)
|
|
|
|
|
|
|
|
ifeq ($(ATMOSPHERE_CPU),generic_x64)
|
|
|
|
export ATMOSPHERE_ARCH_DIR := x64
|
|
|
|
export ATMOSPHERE_BOARD_DIR := generic/windows
|
|
|
|
export ATMOSPHERE_OS_DIR := windows
|
|
|
|
|
|
|
|
export ATMOSPHERE_ARCH_NAME := x64
|
|
|
|
export ATMOSPHERE_BOARD_NAME := generic_windows
|
|
|
|
export ATMOSPHERE_OS_NAME := windows
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
else ifeq ($(ATMOSPHERE_BOARD),generic_linux)
|
|
|
|
|
|
|
|
ifeq ($(ATMOSPHERE_CPU),generic_x64)
|
|
|
|
export ATMOSPHERE_ARCH_DIR := x64
|
|
|
|
export ATMOSPHERE_ARCH_NAME := x64
|
|
|
|
else ifeq ($(ATMOSPHERE_CPU),generic_arm64)
|
|
|
|
export ATMOSPHERE_ARCH_DIR := arm64
|
|
|
|
export ATMOSPHERE_ARCH_NAME := arm64
|
|
|
|
endif
|
|
|
|
|
|
|
|
export ATMOSPHERE_BOARD_DIR := generic/linux
|
|
|
|
export ATMOSPHERE_OS_DIR := linux
|
|
|
|
|
|
|
|
export ATMOSPHERE_BOARD_NAME := generic_linux
|
|
|
|
export ATMOSPHERE_OS_NAME := linux
|
|
|
|
|
|
|
|
else ifeq ($(ATMOSPHERE_BOARD),generic_macos)
|
|
|
|
|
|
|
|
ifeq ($(ATMOSPHERE_CPU),generic_x64)
|
|
|
|
export ATMOSPHERE_ARCH_DIR := x64
|
|
|
|
export ATMOSPHERE_ARCH_NAME := x64
|
|
|
|
else ifeq ($(ATMOSPHERE_CPU),generic_arm64)
|
|
|
|
export ATMOSPHERE_ARCH_DIR := arm64
|
|
|
|
export ATMOSPHERE_ARCH_NAME := arm64
|
|
|
|
endif
|
|
|
|
|
|
|
|
export ATMOSPHERE_BOARD_DIR := generic/macos
|
|
|
|
export ATMOSPHERE_OS_DIR := macos
|
|
|
|
|
|
|
|
export ATMOSPHERE_BOARD_NAME := generic_macos
|
|
|
|
export ATMOSPHERE_OS_NAME := macos
|
|
|
|
|
2019-12-09 12:57:37 +01:00
|
|
|
endif
|
|
|
|
|
2019-12-17 09:37:55 +01:00
|
|
|
ifeq ($(ATMOSPHERE_CPU),arm-cortex-a57)
|
2020-08-11 20:22:56 +02:00
|
|
|
export ATMOSPHERE_CPU_DIR := cortex_a57
|
2019-12-17 09:37:55 +01:00
|
|
|
export ATMOSPHERE_CPU_NAME := arm_cortex_a57
|
|
|
|
endif
|
|
|
|
|
2020-05-05 08:33:16 +02:00
|
|
|
ifeq ($(ATMOSPHERE_CPU),arm7tdmi)
|
2020-08-11 20:22:56 +02:00
|
|
|
export ATMOSPHERE_CPU_DIR := arm7tdmi
|
2020-05-05 08:33:16 +02:00
|
|
|
export ATMOSPHERE_CPU_NAME := arm7tdmi
|
|
|
|
endif
|
|
|
|
|
2022-03-06 21:08:20 +01:00
|
|
|
ifeq ($(ATMOSPHERE_CPU),generic_x64)
|
|
|
|
export ATMOSPHERE_CPU_DIR := generic_x64
|
|
|
|
export ATMOSPHERE_CPU_NAME := generic_x64
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(ATMOSPHERE_CPU),generic_arm64)
|
|
|
|
export ATMOSPHERE_CPU_DIR := generic_arm64
|
|
|
|
export ATMOSPHERE_CPU_NAME := generic_arm64
|
|
|
|
endif
|
2019-12-09 12:57:37 +01:00
|
|
|
|
2020-08-11 20:22:56 +02:00
|
|
|
export ATMOSPHERE_ARCH_MAKE_DIR := $(ATMOSPHERE_CONFIG_MAKE_DIR)/arch/$(ATMOSPHERE_ARCH_DIR)
|
|
|
|
export ATMOSPHERE_BOARD_MAKE_DIR := $(ATMOSPHERE_CONFIG_MAKE_DIR)/board/$(ATMOSPHERE_BOARD_DIR)
|
|
|
|
export ATMOSPHERE_OS_MAKE_DIR := $(ATMOSPHERE_CONFIG_MAKE_DIR)/os/$(ATMOSPHERE_OS_DIR)
|
|
|
|
export ATMOSPHERE_CPU_MAKE_DIR := $(ATMOSPHERE_ARCH_MAKE_DIR)/cpu/$(ATMOSPHERE_CPU_DIR)
|
2019-12-09 12:57:37 +01:00
|
|
|
|
2021-10-31 19:18:17 +01:00
|
|
|
ifneq ($(strip $(ATMOSPHERE_SUB_ARCH_NAME)),)
|
2022-03-06 21:08:20 +01:00
|
|
|
export ATMOSPHERE_FULL_NAME := $(ATMOSPHERE_BOARD_NAME)_$(ATMOSPHERE_ARCH_NAME)_$(ATMOSPHERE_SUB_ARCH_NAME)_$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_LIBRARY_DIR := lib/$(ATMOSPHERE_BOARD_NAME)_$(ATMOSPHERE_ARCH_NAME)_$(ATMOSPHERE_SUB_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_BUILD_DIR := build/$(ATMOSPHERE_BOARD_NAME)_$(ATMOSPHERE_ARCH_NAME)_$(ATMOSPHERE_SUB_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_OUT_DIR := out/$(ATMOSPHERE_BOARD_NAME)_$(ATMOSPHERE_ARCH_NAME)_$(ATMOSPHERE_SUB_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
2021-10-31 19:18:17 +01:00
|
|
|
else
|
2022-03-06 21:08:20 +01:00
|
|
|
export ATMOSPHERE_FULL_NAME := $(ATMOSPHERE_BOARD_NAME)_$(ATMOSPHERE_ARCH_NAME)_$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_LIBRARY_DIR := lib/$(ATMOSPHERE_BOARD_NAME)_$(ATMOSPHERE_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_BUILD_DIR := build/$(ATMOSPHERE_BOARD_NAME)_$(ATMOSPHERE_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_OUT_DIR := out/$(ATMOSPHERE_BOARD_NAME)_$(ATMOSPHERE_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(strip $(ATMOSPHERE_BOOT_ARCH_NAME)),)
|
|
|
|
|
|
|
|
ifneq ($(strip $(ATMOSPHERE_SUB_ARCH_NAME)),)
|
|
|
|
export ATMOSPHERE_BOOT_FULL_NAME := $(ATMOSPHERE_BOOT_BOARD_NAME)_$(ATMOSPHERE_BOOT_ARCH_NAME)_$(ATMOSPHERE_BOOT_SUB_ARCH_NAME)_$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_BOOT_LIBRARY_DIR := lib/$(ATMOSPHERE_BOOT_BOARD_NAME)_$(ATMOSPHERE_BOOT_ARCH_NAME)_$(ATMOSPHERE_BOOT_SUB_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_BOOT_BUILD_DIR := build/$(ATMOSPHERE_BOOT_BOARD_NAME)_$(ATMOSPHERE_BOOT_ARCH_NAME)_$(ATMOSPHERE_BOOT_SUB_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_BOOT_OUT_DIR := out/$(ATMOSPHERE_BOOT_BOARD_NAME)_$(ATMOSPHERE_BOOT_ARCH_NAME)_$(ATMOSPHERE_BOOT_SUB_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
else
|
|
|
|
export ATMOSPHERE_BOOT_FULL_NAME := $(ATMOSPHERE_BOOT_BOARD_NAME)_$(ATMOSPHERE_BOOT_ARCH_NAME)_$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_BOOT_LIBRARY_DIR := lib/$(ATMOSPHERE_BOOT_BOARD_NAME)_$(ATMOSPHERE_BOOT_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_BOOT_BUILD_DIR := build/$(ATMOSPHERE_BOOT_BOARD_NAME)_$(ATMOSPHERE_BOOT_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
export ATMOSPHERE_BOOT_OUT_DIR := out/$(ATMOSPHERE_BOOT_BOARD_NAME)_$(ATMOSPHERE_BOOT_ARCH_NAME)/$(ATMOSPHERE_BUILD_NAME)
|
|
|
|
endif
|
|
|
|
|
|
|
|
else
|
|
|
|
export ATMOSPHERE_BOOT_FULL_NAME := $(ATMOSPHERE_FULL_NAME)
|
|
|
|
export ATMOSPHERE_BOOT_LIBRARY_DIR := $(ATMOSPHERE_LIBRARY_DIR)
|
|
|
|
export ATMOSPHERE_BOOT_BUILD_DIR := $(ATMOSPHERE_BUILD_DIR)
|
|
|
|
export ATMOSPHERE_BOOT_OUT_DIR := $(ATMOSPHERE_OUT_DIR)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(ATMOSPHERE_BOOT_CPU)),)
|
|
|
|
export ATMOSPHERE_BOOT_CPU := $(ATMOSPHERE_CPU)
|
2021-10-31 19:18:17 +01:00
|
|
|
endif
|
2020-05-05 08:33:16 +02:00
|
|
|
|
2019-12-09 12:57:37 +01:00
|
|
|
include $(ATMOSPHERE_ARCH_MAKE_DIR)/arch.mk
|
|
|
|
include $(ATMOSPHERE_BOARD_MAKE_DIR)/board.mk
|
|
|
|
include $(ATMOSPHERE_OS_MAKE_DIR)/os.mk
|
2019-12-17 09:37:55 +01:00
|
|
|
include $(ATMOSPHERE_CPU_MAKE_DIR)/cpu.mk
|
2019-12-09 12:57:37 +01:00
|
|
|
|
2021-10-31 19:18:17 +01:00
|
|
|
|
|
|
|
ifneq ($(strip $(ATMOSPHERE_SUB_ARCH_NAME)),)
|
|
|
|
export ATMOSPHERE_SUB_ARCH_MAKE_DIR := $(ATMOSPHERE_CONFIG_MAKE_DIR)/arch/$(ATMOSPHERE_SUB_ARCH_DIR)
|
|
|
|
|
|
|
|
include $(ATMOSPHERE_SUB_ARCH_MAKE_DIR)/arch.mk
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2019-12-09 12:57:37 +01:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# get atmosphere git revision information
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
export ATMOSPHERE_GIT_BRANCH := $(shell git symbolic-ref --short HEAD)
|
|
|
|
|
|
|
|
ifeq ($(strip $(shell git status --porcelain 2>/dev/null)),)
|
|
|
|
export ATMOSPHERE_GIT_REVISION := $(ATMOSPHERE_GIT_BRANCH)-$(shell git rev-parse --short HEAD)
|
|
|
|
else
|
|
|
|
export ATMOSPHERE_GIT_REVISION := $(ATMOSPHERE_GIT_BRANCH)-$(shell git rev-parse --short HEAD)-dirty
|
|
|
|
endif
|
|
|
|
|
2020-05-15 11:32:17 +02:00
|
|
|
export ATMOSPHERE_GIT_HASH := $(shell git rev-parse --short=16 HEAD)
|
|
|
|
|
|
|
|
ATMOSPHERE_DEFINES += -DATMOSPHERE_GIT_BRANCH=\"$(ATMOSPHERE_GIT_BRANCH)\" -DATMOSPHERE_GIT_REVISION=\"$(ATMOSPHERE_GIT_REVISION)\" -DATMOSPHERE_GIT_HASH="0x$(ATMOSPHERE_GIT_HASH)"
|
2019-12-09 12:57:37 +01:00
|
|
|
|
2019-12-12 22:38:11 +01:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# Ensure top directory is set.
|
|
|
|
#---------------------------------------------------------------------------------
|
2019-12-13 21:41:19 +01:00
|
|
|
TOPDIR ?= $(CURDIR)
|
2019-12-12 22:38:11 +01:00
|
|
|
|
2019-12-09 12:57:37 +01:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# TARGET is the name of the output
|
|
|
|
# SOURCES is a list of directories containing source code
|
|
|
|
# DATA is a list of directories containing data files
|
|
|
|
# INCLUDES is a list of directories containing header files
|
|
|
|
#---------------------------------------------------------------------------------
|
2019-12-13 21:41:19 +01:00
|
|
|
TARGET := $(notdir $(CURDIR))
|
|
|
|
BUILD := build
|
|
|
|
DATA := data
|
|
|
|
INCLUDES := include
|
2019-12-09 12:57:37 +01:00
|
|
|
|
2020-12-29 21:28:07 +01:00
|
|
|
GENERAL_SOURCE_DIRS=$1 $(foreach d,$(filter-out $1/arch $1/board $1/os $1/cpu $1,$(wildcard $1/*)),$(if $(wildcard $d/.),$(filter-out $d,$(call GENERAL_SOURCE_DIRS,$d)) $d,))
|
2021-10-31 19:18:17 +01:00
|
|
|
|
2020-08-11 20:22:56 +02:00
|
|
|
SPECIFIC_SOURCE_DIRS=$(if $(wildcard $1/$2/$3/.*),$1/$2/$3 $(call DIR_WILDCARD,$1/$2/$3),$(if $(wildcard $1/$2/generic/.*), $1/$2/generic $(call DIR_WILDCARD,$1/$2/generic),))
|
2021-10-31 19:18:17 +01:00
|
|
|
|
|
|
|
ifneq ($(strip $(ATMOSPHERE_SUB_ARCH_NAME)),)
|
|
|
|
SPECIFIC_SOURCE_DIRS_ARCH=$(if $(wildcard $1/$2/$3/.*),$1/$2/$3 $(call DIR_WILDCARD,$1/$2/$3),$(if $(wildcard $1/$2/$4/.*),$1/$2/$4 $(call DIR_WILDCARD,$1/$2/$4),$(if $(wildcard $1/$2/generic/.*), $1/$2/generic $(call DIR_WILDCARD,$1/$2/generic),)))
|
|
|
|
else
|
|
|
|
SPECIFIC_SOURCE_DIRS_ARCH=$(if $(wildcard $1/$2/$3/.*),$1/$2/$3 $(call DIR_WILDCARD,$1/$2/$3),$(if $(wildcard $1/$2/generic/.*), $1/$2/generic $(call DIR_WILDCARD,$1/$2/generic),))
|
|
|
|
endif
|
|
|
|
|
2020-08-15 18:20:11 +02:00
|
|
|
UNFILTERED_SOURCE_DIRS=$1 $(foreach d,$(wildcard $1/*),$(if $(wildcard $d/.),$(call DIR_WILDCARD,$d) $d,))
|
2020-08-11 20:22:56 +02:00
|
|
|
|
2020-12-29 21:28:07 +01:00
|
|
|
ALL_SOURCE_DIRS=$(foreach d,$(call GENERAL_SOURCE_DIRS,$1), \
|
|
|
|
$d \
|
2021-10-31 19:18:17 +01:00
|
|
|
$(call SPECIFIC_SOURCE_DIRS_ARCH,$d,arch,$(ATMOSPHERE_ARCH_DIR),$(ATMOSPHERE_SUB_ARCH_DIR)) \
|
2020-12-29 21:28:07 +01:00
|
|
|
$(call SPECIFIC_SOURCE_DIRS,$d,board,$(ATMOSPHERE_BOARD_DIR)) \
|
|
|
|
$(call SPECIFIC_SOURCE_DIRS,$d,os,$(ATMOSPHERE_OS_DIR)) \
|
|
|
|
$(call SPECIFIC_SOURCE_DIRS,$d,cpu,$(ATMOSPHERE_ARCH_DIR)/$(ATMOSPHERE_CPU_DIR)) \
|
|
|
|
)
|
2020-02-23 15:51:32 +01:00
|
|
|
|
|
|
|
SOURCES ?= $(call ALL_SOURCE_DIRS,source)
|
2020-02-19 10:22:51 +01:00
|
|
|
|
2020-08-11 20:22:56 +02:00
|
|
|
FIND_SPECIFIC_SOURCE_FILES= $(notdir $(wildcard $1/*.$2.$3.$4)) $(filter-out $(subst .$2.$3.,.$2.generic.,$(notdir $(wildcard $1/*.$2.$3.$4))),$(notdir $(wildcard $1/*.$2.generic.$4)))
|
|
|
|
|
2020-08-11 20:43:34 +02:00
|
|
|
FIND_SPECIFIC_SOURCE_FILES_EX=$(foreach ext,$3,$(notdir $(wildcard $1/*.$2.$(ext).$4))) $(filter-out $(foreach ext,$3,$(subst .$2.$(ext).,.$2.generic.,$(notdir $(wildcard $1/*.$2.$(ext).$4)))),$(notdir $(wildcard $1/*.$2.generic.$4)))
|
|
|
|
|
2020-08-11 20:22:56 +02:00
|
|
|
FIND_SOURCE_FILES=$(foreach dir,$1,$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.$2)) \
|
|
|
|
$(notdir $(wildcard $(dir)/*.board.*.$2)) \
|
|
|
|
$(notdir $(wildcard $(dir)/*.os.*.$2)) \
|
|
|
|
$(notdir $(wildcard $(dir)/.cpu.*.$2)), \
|
|
|
|
$(notdir $(wildcard $(dir)/*.$2)))) \
|
2021-10-31 19:18:17 +01:00
|
|
|
$(foreach dir,$1,$(call FIND_SPECIFIC_SOURCE_FILES_EX,$(dir),arch,$(ATMOSPHERE_ARCH_NAME) $(ATMOSPHERE_SUB_ARCH_NAME),$2)) \
|
2020-08-11 20:22:56 +02:00
|
|
|
$(foreach dir,$1,$(call FIND_SPECIFIC_SOURCE_FILES,$(dir),board,$(ATMOSPHERE_BOARD_NAME),$2)) \
|
|
|
|
$(foreach dir,$1,$(call FIND_SPECIFIC_SOURCE_FILES,$(dir),os,$(ATMOSPHERE_OS_NAME),$2)) \
|
2020-08-11 20:43:34 +02:00
|
|
|
$(foreach dir,$1,$(call FIND_SPECIFIC_SOURCE_FILES_EX,$(dir),cpu,$(ATMOSPHERE_CPU_NAME) $(ATMOSPHERE_CPU_EXTENSIONS),$2))
|
2020-08-11 20:22:56 +02:00
|
|
|
|
2022-03-06 21:08:20 +01:00
|
|
|
ATMOSPHERE_GCH_IDENTIFIER := $(ATMOSPHERE_FULL_NAME)
|
2020-10-27 21:55:19 +01:00
|
|
|
|
2020-02-19 10:22:51 +01:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# Rules for compiling pre-compiled headers
|
|
|
|
#---------------------------------------------------------------------------------
|
2022-03-06 21:08:20 +01:00
|
|
|
%.hpp.gch/$(ATMOSPHERE_GCH_IDENTIFIER): %.hpp %.hpp.gch
|
2020-10-30 19:54:30 +01:00
|
|
|
@echo Precompiling $(notdir $<) for $(ATMOSPHERE_GCH_IDENTIFIER)
|
2020-10-27 21:55:19 +01:00
|
|
|
$(SILENTCMD)$(CXX) -w -x c++-header -MMD -MP -MQ$@ -MF $(DEPSDIR)/$(notdir $*).d $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
|
|
|
|
|
|
|
%.hpp.gch: %.hpp
|
2022-03-06 21:08:20 +01:00
|
|
|
@[ -d $@ ] || mkdir -p $@
|