Skip to content

Commit

Permalink
Remove a lot of legacy build logic and simplify remaining logic. (#21745
Browse files Browse the repository at this point in the history
)

* Remove lots of legacy build logic.
* When building native bits, put them in ".libs/\<runtimeidentifier\>" as
  opposed to ".libs/\<not quite runtimeidentifier\>", because it simplifies a
  lot of logic.
  • Loading branch information
rolfbjarne authored Dec 11, 2024
1 parent 9d66ed2 commit a5ea108
Show file tree
Hide file tree
Showing 67 changed files with 976 additions and 2,091 deletions.
287 changes: 55 additions & 232 deletions Make.config

Large diffs are not rendered by default.

73 changes: 0 additions & 73 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ show-versions:
@echo " The .NET NuGet(s):"
@$(foreach platform,$(DOTNET_PLATFORMS),echo " Microsoft.$(platform) $($(shell echo $(platform) | tr 'a-z' 'A-Z')_NUGET_VERSION_FULL)";)

check-permissions:
ifdef INCLUDE_MAC
@UNREADABLE=`find $(MAC_DESTDIR) ! -perm -0644`; if ! test -z "$$UNREADABLE"; then echo "There are files with invalid permissions (all installed files at least be readable by everybody, and writable by owner: 0644): "; find $(MAC_DESTDIR) ! -perm -0644 | xargs ls -la; exit 1; fi
@echo Validated file permissions for Xamarin.Mac.
endif
ifdef INCLUDE_IOS
@UNREADABLE=`find $(IOS_DESTDIR) ! -perm -0644`; if ! test -z "$$UNREADABLE"; then echo "There are files with invalid permissions (all installed files at least be readable by everybody, and writable by owner: 0644): "; find $(IOS_DESTDIR) ! -perm -0644 | xargs ls -la; exit 1; fi
@echo Validated file permissions for Xamarin.iOS.
endif

all-local:: global.json

# This tells NuGet to use the exact same dotnet version we've configured in Make.config
Expand All @@ -71,34 +61,6 @@ install-hook::
fi

install-hook::
@$(MAKE) check-permissions
ifdef INCLUDE_IOS
ifneq ($(findstring $(IOS_DESTDIR)$(MONOTOUCH_PREFIX),$(shell ls -l /Library/Frameworks/Xamarin.iOS.framework/Versions/Current 2>&1)),)
@echo
@echo " This build of Xamarin.iOS is the now default version on your system. "
@echo
else
@echo
@echo " Xamarin.iOS has not been installed into your system by 'make install'"
@echo " In order to set the currently built Xamarin.iOS as your system version,"
@echo " execute 'make install-system'".
@echo
endif
endif
ifdef INCLUDE_MAC
ifndef INCLUDE_IOS
@echo
endif
ifneq ($(findstring $(abspath $(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Versions),$(shell ls -l $(MAC_FRAMEWORK_DIR)/Versions/Current 2>&1)),)
@echo " This build of Xamarin.Mac is the now default version on your system. "
@echo
else
@echo " Xamarin.Mac has not been installed into your system by 'make install'"
@echo " In order to set the currently built Xamarin.Mac as your system version,"
@echo " execute 'make install-system'".
@echo
endif
endif
$(Q) $(MAKE) -C dotnet shutdown-build-server

.PHONY: package release
Expand All @@ -117,41 +79,6 @@ package release:
dotnet-install-system:
$(Q) $(MAKE) -C dotnet install-system

install-system: install-system-ios install-system-mac
@# Clean up some old files
$(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS
$(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.CSharp.targets
$(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.Common.CSharp.targets
$(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.Tasks.dll
$(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac
$(Q) $(MAKE) install-symlinks MAC_DESTDIR=/ MAC_INSTALL_VERSION=Current IOS_DESTDIR=/ IOS_INSTALL_VERSION=Current -C msbuild V=$(V)

install-system-ios:
ifdef INCLUDE_IOS
@if ! test -s "$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/buildinfo"; then echo "The Xamarin.iOS build seems incomplete. Did you run \"make install\"?"; exit 1; fi
$(Q) rm -f /Library/Frameworks/Xamarin.iOS.framework/Versions/Current
$(Q) mkdir -p /Library/Frameworks/Xamarin.iOS.framework/Versions
$(Q) ln -s $(IOS_DESTDIR)$(MONOTOUCH_PREFIX) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current
$(Q) echo Installed Xamarin.iOS into /Library/Frameworks/Xamarin.iOS.framework/Versions/Current
endif

install-system-mac:
ifdef INCLUDE_MAC
@if ! test -s "$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/buildinfo" ; then echo "The Xamarin.Mac build seems incomplete. Did you run \"make install\"?"; exit 1; fi
$(Q) rm -f $(MAC_FRAMEWORK_DIR)/Versions/Current
$(Q) mkdir -p $(MAC_FRAMEWORK_DIR)/Versions
$(Q) ln -s $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR) $(MAC_FRAMEWORK_DIR)/Versions/Current
$(Q) echo Installed Xamarin.Mac into $(MAC_FRAMEWORK_DIR)/Versions/Current
endif

fix-install-permissions:
sudo mkdir -p /Library/Frameworks/Mono.framework/External/
sudo mkdir -p /Library/Frameworks/Xamarin.iOS.framework
sudo mkdir -p /Library/Frameworks/Xamarin.Mac.framework
sudo chown -R $(USER) /Library/Frameworks/Mono.framework/External/
sudo chown -R $(USER) /Library/Frameworks/Xamarin.iOS.framework
sudo chown -R $(USER) /Library/Frameworks/Xamarin.Mac.framework

fix-xcode-select:
sudo xcode-select -s $(XCODE_DEVELOPER_ROOT)

Expand Down
17 changes: 0 additions & 17 deletions mk/quiet.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,6 @@ Q_PROF_SN = $(if $(V),,@echo "SN [$(1)] $(@F)";)
Q_1 = $(if $(V),,@echo "$(1) $(@F)";)
Q_2 = $(if $(V),,@echo "$(1) $(2) $(@F)";)

ASCOMPILE = $(Q_AS) $(AS)
CSCOMPILE = $(Q_MCS) $(MCS)
CCOMPILE = $(Q_CC) $(CC)
CXXCOMPILE = $(Q_CC) $(CXX)
OBJCCOMPILE = $(Q_OBJC) $(CC)

DEVICE_OBJCCOMPILE = $(Q_OBJC) $(DEVICE_CC)
DEVICE_OBJCTCOMPILE = $(QT_OBJC) $(DEVICE_CC)
DEVICE_CCOMPILE = $(Q_CC) $(DEVICE_CC)
DEVICE_CTCOMPILE = $(QT_CC) $(DEVICE_CC)

SIMULATOR_OBJCCOMPILE = $(Q_OBJC) $(SIMULATOR_CC)
SIMULATOR_OBJCTCOMPILE = $(QT_OBJC) $(SIMULATOR_CC)
SIMULATOR_CCOMPILE = $(Q_CC) $(SIMULATOR_CC)
SIMULATOR_CTCOMPILE = $(QT_CC) $(SIMULATOR_CC)
SIMULATOR_ASCOMPILE = $(Q_AS) $(SIMULATOR_CC)

ifeq ($(V),)
ifeq ($(BUILD_REVISION)$(JENKINS_HOME),)
# non-verbose local build
Expand Down
Loading

10 comments on commit a5ea108

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.