diff --git a/config/common.mk b/config/common.mk index ed196586..7ef3708f 100644 --- a/config/common.mk +++ b/config/common.mk @@ -297,6 +297,23 @@ FIND_SOURCE_FILES=$(foreach dir,$1,$(filter-out $(notdir $(wildcard $(dir)/*.arc ATMOSPHERE_GCH_IDENTIFIER := $(ATMOSPHERE_FULL_NAME) +#--------------------------------------------------------------------------------- +# Python. The scripts should work with Python 2 or 3, but 2 is preferred. +#--------------------------------------------------------------------------------- +PYTHON = $(shell command -v python >/dev/null && echo python || echo python3) + +#--------------------------------------------------------------------------------- +# Export MAKE: +# GCC's LTO driver invokes Make internally. This invocation respects both $(MAKE) +# and $(MAKEFLAGS), but only if they're in the environment. By default, MAKEFLAGS +# is in the environment while MAKE isn't, so GCC will always use the default +# `make` command, yet it inherits MAKEFLAGS from the copy of Make the user +# invoked, which might have incompatible flags. In practice this is an issue on +# macOS when running e.g. `gmake -j32 -Otarget`. This behavior is arguably a bug +# in GCC and/or Make, but we can work around it by exporting MAKE. +#--------------------------------------------------------------------------------- +export MAKE + #--------------------------------------------------------------------------------- # Rules for compiling pre-compiled headers #--------------------------------------------------------------------------------- diff --git a/libexosphere/libexosphere.mk b/libexosphere/libexosphere.mk index c24c9472..616e1e53 100644 --- a/libexosphere/libexosphere.mk +++ b/libexosphere/libexosphere.mk @@ -104,7 +104,7 @@ clean: @echo clean $(ATMOSPHERE_BUILD_NAME) ... @rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR) @rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER)) - @for i in $(GCH_DIRS); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done + @for i in $(GCH_DIRS); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done $(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS): @[ -d $@ ] || mkdir -p $@ diff --git a/libmesosphere/libmesosphere.mk b/libmesosphere/libmesosphere.mk index 79c2c13e..2ab310a2 100644 --- a/libmesosphere/libmesosphere.mk +++ b/libmesosphere/libmesosphere.mk @@ -86,7 +86,7 @@ clean: @echo clean $(ATMOSPHERE_BUILD_NAME) ... @rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR) @rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER)) - @for i in $(GCH_DIRS); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done + @for i in $(GCH_DIRS); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done $(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS): @[ -d $@ ] || mkdir -p $@ diff --git a/libstratosphere/libstratosphere.mk b/libstratosphere/libstratosphere.mk index faec4fdb..5c444caf 100644 --- a/libstratosphere/libstratosphere.mk +++ b/libstratosphere/libstratosphere.mk @@ -118,7 +118,7 @@ clean: @echo clean $(ATMOSPHERE_BUILD_NAME) ... @rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR) @rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER)) - @for i in $(GCH_DIRS); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done + @for i in $(GCH_DIRS); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done $(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS): @[ -d $@ ] || mkdir -p $@