xamarin-macios/tools/mmp/Makefile

105 строки
4.8 KiB
Makefile
Исходник Обычный вид История

2016-04-21 15:57:02 +03:00
TOP=../..
include $(TOP)/Make.config
export DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT)
#
# mmp
#
MMP_CONF=Release
MMP_DIR=bin/$(MMP_CONF)
LOCAL_MMP=$(MMP_DIR)/mmp.exe
# mmp.csproj.inc contains the mmp_dependencies variable used to determine if mmp needs to be rebuilt or not.
mmp.csproj.inc: Makefile ../common/create-makefile-fragment.sh $(TOP)/Make.config
$(Q_GEN) ../common/create-makefile-fragment.sh $(CURDIR)/mmp.csproj
-include mmp.csproj.inc
$(MMP_DIR)/mmp.exe: $(mmp_dependencies)
$(Q_GEN) $(SYSTEM_MSBUILD) $(TOP)/Xamarin.Mac.sln "/t:mmp" $(XBUILD_VERBOSITY) /p:Configuration=$(MMP_CONF)
2016-04-21 15:57:02 +03:00
MMP_TARGETS = \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/mmp \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp/mmp.exe \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp/Xamarin.Mac.registrar.mobile.a \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp/Xamarin.Mac.registrar.full.a \
MMP_DIRECTORIES = \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/mmp: mmp.in | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin
$(Q_GEN) sed 's!@XAMARIN_MAC_PREFIX@!$(abspath $(MAC_TARGETDIR)$(MAC_FRAMEWORK_CURRENT_DIR))!g' $< > $@
$(Q) chmod +x $@
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp/mmp.exe: $(MMP_DIR)/mmp.exe | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp
$(Q) $(CP) $(dir $<)/*.exe $(dir $@)
$(Q) $(CP) $(dir $<)/*.dll $(dir $@)
$(Q) $(CP) $(dir $<)/*.pdb $(dir $@)
2016-04-21 15:57:02 +03:00
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp/Xamarin.Mac.registrar.%.a: Xamarin.Mac.registrar.%.a | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp
$(Q) $(CP) $<* $(dir $@)
$(MMP_DIRECTORIES):
$(Q) mkdir -p $@
2016-04-21 15:57:02 +03:00
#
# Partial static registrar libraries
#
GENERATE_PART_REGISTRAR = $(Q_GEN) $(SYSTEM_MONO) --debug $(LOCAL_MMP) --xamarin-framework-directory=$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR) -q --runregistrar:$(abspath $@) --sdkroot $(XCODE_DEVELOPER_ROOT) --sdk $(OSX_SDK_VERSION) $< --registrar:static
[builds] Improve mono/llvm dependencies. (#1948) * [builds] Improve mono/llvm dependencies. * Create a list of all the files in the mono and llvm repositories, and save these lists as a Make variable (in a generated Makefile - .deps.*.mk). We don't list _all_ the files in each repository, because there are quite a few (55k for mono), and Make measurably takes a while to check all of them, so try to limit it to a sane subset, without risking missing changes to files that actually matters. * Always create stamp files when we're done with mono builds. * Modify the mono/llvm builds to depend on all the files in their repositories. * Explicitly list the corresponding .stamp-build-* files as dependencies for various files that are produced by the mono builds, so that make knows how to build these files. * Rewrite the *-facade-check targets to depend on the corresponding *_BCL_TARGETS, so that we can avoid running a submake to the same Makefile to execute the facade checks. It now takes a little while (less than a second on my machine, which is fine) for make to list all dependencies and get their timestamps, but if executing multiple submakes this adds up to a multi-second timewaste. So avoid the timewaste by not doing submakes, but instead use dependencies to enforce the required target execution ordering. * Don't depend on nicely named intermediate targets, since won't prevent rebuilds: build-cross64: setup-cross64 Since the `setup-cross64` file doesn't exist, `build-cross64` will always execute. Instead depend on the stamp file: build-cross64: .stamp-configure-cross64 And now `build-cross64` will only rebuild if needed. * Don't try to list all intermediate files as .SECONDARY dependencies, instead list none at all, which works as if all files were listed as dependencies. * Some targets had to move later in the file, since variables used in dependencies: foo: $(VARIABLE) must be defined before that point in the file, as opposed to variables used in recipes: foo: $(MAKE) $(VARIABLE) can be defined anywhere in the Makefile. * Simplify the targets that sign assemblies significantly. There are a few end results: * It's now possible to do `make install`, without doing `make all` first. This might seem weird, but that also ensures the more common `make all install` works properly. * Remakes (without any mono/llvm changes) in build/ are much faster, because we now won't recurse into every mono build: $ time make all -C builds/ -j8 [...] real 0m1.873s This even means that we might be able to make it a habit to remake in the root directory, which doesn't take forever now: $ time make all -j8 [...] real 0m4.521s Unfortunately adding `make install` to the mix still does some useless stuff, and it ends up taking ~30 seconds to complete a full build: $ time make all install -j8 [...] real 0m32.542s * [msbuild] Don't verify the xml syntax of targets files unless the files change. * [build] Don't depend on installed files. Don't depend on installed files, because that causes a rebuild when installing to a different directory (i.e. package creation). * Bump maccore to get build improvements. Rebuilds are now very fast: $ make all install -j8 $ time make all install -j8 real 0m5.735s Less than 6s to figure out that nothing needs to be done. And strangely flushing the disk cache doesn't make it much slower: $ sudo purge $ time make all install -j8 real 0m7.309s Which probably means that Make mostly reads file metadata, and not actual file contents (which is good).
2017-03-31 21:23:38 +03:00
Xamarin.Mac.registrar.mobile.i386.m: $(TOP)/src/build/mac/mobile-32/Xamarin.Mac.dll $(LOCAL_MMP)
$(GENERATE_PART_REGISTRAR) --target-framework Xamarin.Mac,Version=v2.0,Profile=Mobile --arch=i386
$(Q) touch Xamarin.Mac.registrar.mobile.i386.m Xamarin.Mac.registrar.mobile.i386.h
[builds] Improve mono/llvm dependencies. (#1948) * [builds] Improve mono/llvm dependencies. * Create a list of all the files in the mono and llvm repositories, and save these lists as a Make variable (in a generated Makefile - .deps.*.mk). We don't list _all_ the files in each repository, because there are quite a few (55k for mono), and Make measurably takes a while to check all of them, so try to limit it to a sane subset, without risking missing changes to files that actually matters. * Always create stamp files when we're done with mono builds. * Modify the mono/llvm builds to depend on all the files in their repositories. * Explicitly list the corresponding .stamp-build-* files as dependencies for various files that are produced by the mono builds, so that make knows how to build these files. * Rewrite the *-facade-check targets to depend on the corresponding *_BCL_TARGETS, so that we can avoid running a submake to the same Makefile to execute the facade checks. It now takes a little while (less than a second on my machine, which is fine) for make to list all dependencies and get their timestamps, but if executing multiple submakes this adds up to a multi-second timewaste. So avoid the timewaste by not doing submakes, but instead use dependencies to enforce the required target execution ordering. * Don't depend on nicely named intermediate targets, since won't prevent rebuilds: build-cross64: setup-cross64 Since the `setup-cross64` file doesn't exist, `build-cross64` will always execute. Instead depend on the stamp file: build-cross64: .stamp-configure-cross64 And now `build-cross64` will only rebuild if needed. * Don't try to list all intermediate files as .SECONDARY dependencies, instead list none at all, which works as if all files were listed as dependencies. * Some targets had to move later in the file, since variables used in dependencies: foo: $(VARIABLE) must be defined before that point in the file, as opposed to variables used in recipes: foo: $(MAKE) $(VARIABLE) can be defined anywhere in the Makefile. * Simplify the targets that sign assemblies significantly. There are a few end results: * It's now possible to do `make install`, without doing `make all` first. This might seem weird, but that also ensures the more common `make all install` works properly. * Remakes (without any mono/llvm changes) in build/ are much faster, because we now won't recurse into every mono build: $ time make all -C builds/ -j8 [...] real 0m1.873s This even means that we might be able to make it a habit to remake in the root directory, which doesn't take forever now: $ time make all -j8 [...] real 0m4.521s Unfortunately adding `make install` to the mix still does some useless stuff, and it ends up taking ~30 seconds to complete a full build: $ time make all install -j8 [...] real 0m32.542s * [msbuild] Don't verify the xml syntax of targets files unless the files change. * [build] Don't depend on installed files. Don't depend on installed files, because that causes a rebuild when installing to a different directory (i.e. package creation). * Bump maccore to get build improvements. Rebuilds are now very fast: $ make all install -j8 $ time make all install -j8 real 0m5.735s Less than 6s to figure out that nothing needs to be done. And strangely flushing the disk cache doesn't make it much slower: $ sudo purge $ time make all install -j8 real 0m7.309s Which probably means that Make mostly reads file metadata, and not actual file contents (which is good).
2017-03-31 21:23:38 +03:00
Xamarin.Mac.registrar.mobile.x86_64.m: $(TOP)/src/build/mac/mobile-64/Xamarin.Mac.dll $(LOCAL_MMP)
$(GENERATE_PART_REGISTRAR) --target-framework Xamarin.Mac,Version=v2.0,Profile=Mobile --arch=x86_64
$(Q) touch Xamarin.Mac.registrar.mobile.x86_64.m Xamarin.Mac.registrar.mobile.x86_64.h
[builds] Improve mono/llvm dependencies. (#1948) * [builds] Improve mono/llvm dependencies. * Create a list of all the files in the mono and llvm repositories, and save these lists as a Make variable (in a generated Makefile - .deps.*.mk). We don't list _all_ the files in each repository, because there are quite a few (55k for mono), and Make measurably takes a while to check all of them, so try to limit it to a sane subset, without risking missing changes to files that actually matters. * Always create stamp files when we're done with mono builds. * Modify the mono/llvm builds to depend on all the files in their repositories. * Explicitly list the corresponding .stamp-build-* files as dependencies for various files that are produced by the mono builds, so that make knows how to build these files. * Rewrite the *-facade-check targets to depend on the corresponding *_BCL_TARGETS, so that we can avoid running a submake to the same Makefile to execute the facade checks. It now takes a little while (less than a second on my machine, which is fine) for make to list all dependencies and get their timestamps, but if executing multiple submakes this adds up to a multi-second timewaste. So avoid the timewaste by not doing submakes, but instead use dependencies to enforce the required target execution ordering. * Don't depend on nicely named intermediate targets, since won't prevent rebuilds: build-cross64: setup-cross64 Since the `setup-cross64` file doesn't exist, `build-cross64` will always execute. Instead depend on the stamp file: build-cross64: .stamp-configure-cross64 And now `build-cross64` will only rebuild if needed. * Don't try to list all intermediate files as .SECONDARY dependencies, instead list none at all, which works as if all files were listed as dependencies. * Some targets had to move later in the file, since variables used in dependencies: foo: $(VARIABLE) must be defined before that point in the file, as opposed to variables used in recipes: foo: $(MAKE) $(VARIABLE) can be defined anywhere in the Makefile. * Simplify the targets that sign assemblies significantly. There are a few end results: * It's now possible to do `make install`, without doing `make all` first. This might seem weird, but that also ensures the more common `make all install` works properly. * Remakes (without any mono/llvm changes) in build/ are much faster, because we now won't recurse into every mono build: $ time make all -C builds/ -j8 [...] real 0m1.873s This even means that we might be able to make it a habit to remake in the root directory, which doesn't take forever now: $ time make all -j8 [...] real 0m4.521s Unfortunately adding `make install` to the mix still does some useless stuff, and it ends up taking ~30 seconds to complete a full build: $ time make all install -j8 [...] real 0m32.542s * [msbuild] Don't verify the xml syntax of targets files unless the files change. * [build] Don't depend on installed files. Don't depend on installed files, because that causes a rebuild when installing to a different directory (i.e. package creation). * Bump maccore to get build improvements. Rebuilds are now very fast: $ make all install -j8 $ time make all install -j8 real 0m5.735s Less than 6s to figure out that nothing needs to be done. And strangely flushing the disk cache doesn't make it much slower: $ sudo purge $ time make all install -j8 real 0m7.309s Which probably means that Make mostly reads file metadata, and not actual file contents (which is good).
2017-03-31 21:23:38 +03:00
Xamarin.Mac.registrar.full.i386.m: $(TOP)/src/build/mac/full-32/Xamarin.Mac.dll $(LOCAL_MMP)
$(GENERATE_PART_REGISTRAR) --target-framework 4.5 --arch=i386 --xamarin-full-framework --nolink
$(Q) touch Xamarin.Mac.registrar.full.i386.m Xamarin.Mac.registrar.full.i386.h
[builds] Improve mono/llvm dependencies. (#1948) * [builds] Improve mono/llvm dependencies. * Create a list of all the files in the mono and llvm repositories, and save these lists as a Make variable (in a generated Makefile - .deps.*.mk). We don't list _all_ the files in each repository, because there are quite a few (55k for mono), and Make measurably takes a while to check all of them, so try to limit it to a sane subset, without risking missing changes to files that actually matters. * Always create stamp files when we're done with mono builds. * Modify the mono/llvm builds to depend on all the files in their repositories. * Explicitly list the corresponding .stamp-build-* files as dependencies for various files that are produced by the mono builds, so that make knows how to build these files. * Rewrite the *-facade-check targets to depend on the corresponding *_BCL_TARGETS, so that we can avoid running a submake to the same Makefile to execute the facade checks. It now takes a little while (less than a second on my machine, which is fine) for make to list all dependencies and get their timestamps, but if executing multiple submakes this adds up to a multi-second timewaste. So avoid the timewaste by not doing submakes, but instead use dependencies to enforce the required target execution ordering. * Don't depend on nicely named intermediate targets, since won't prevent rebuilds: build-cross64: setup-cross64 Since the `setup-cross64` file doesn't exist, `build-cross64` will always execute. Instead depend on the stamp file: build-cross64: .stamp-configure-cross64 And now `build-cross64` will only rebuild if needed. * Don't try to list all intermediate files as .SECONDARY dependencies, instead list none at all, which works as if all files were listed as dependencies. * Some targets had to move later in the file, since variables used in dependencies: foo: $(VARIABLE) must be defined before that point in the file, as opposed to variables used in recipes: foo: $(MAKE) $(VARIABLE) can be defined anywhere in the Makefile. * Simplify the targets that sign assemblies significantly. There are a few end results: * It's now possible to do `make install`, without doing `make all` first. This might seem weird, but that also ensures the more common `make all install` works properly. * Remakes (without any mono/llvm changes) in build/ are much faster, because we now won't recurse into every mono build: $ time make all -C builds/ -j8 [...] real 0m1.873s This even means that we might be able to make it a habit to remake in the root directory, which doesn't take forever now: $ time make all -j8 [...] real 0m4.521s Unfortunately adding `make install` to the mix still does some useless stuff, and it ends up taking ~30 seconds to complete a full build: $ time make all install -j8 [...] real 0m32.542s * [msbuild] Don't verify the xml syntax of targets files unless the files change. * [build] Don't depend on installed files. Don't depend on installed files, because that causes a rebuild when installing to a different directory (i.e. package creation). * Bump maccore to get build improvements. Rebuilds are now very fast: $ make all install -j8 $ time make all install -j8 real 0m5.735s Less than 6s to figure out that nothing needs to be done. And strangely flushing the disk cache doesn't make it much slower: $ sudo purge $ time make all install -j8 real 0m7.309s Which probably means that Make mostly reads file metadata, and not actual file contents (which is good).
2017-03-31 21:23:38 +03:00
Xamarin.Mac.registrar.full.x86_64.m: $(TOP)/src/build/mac/full-64/Xamarin.Mac.dll $(LOCAL_MMP)
$(GENERATE_PART_REGISTRAR) --target-framework 4.5 --arch=x86_64 --xamarin-full-framework --nolink
$(Q) touch Xamarin.Mac.registrar.full.x86_64.m Xamarin.Mac.registrar.full.x86_64.h
Xamarin.Mac.registrar.%.i386.a: Xamarin.Mac.registrar.%.i386.m
$(Q_CC) xcrun -sdk macosx clang -DDEBUG -g -gdwarf-2 -x objective-c++ -stdlib=libc++ -o $@ -c -arch i386 $< -Wall -Wno-unguarded-availability-new -I$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/include -mmacosx-version-min=$(MIN_OSX_SDK_VERSION)
Xamarin.Mac.registrar.%.x86_64.a: Xamarin.Mac.registrar.%.x86_64.m
$(Q_CC) xcrun -sdk macosx clang -DDEBUG -g -gdwarf-2 -x objective-c++ -stdlib=libc++ -o $@ -c -arch x86_64 $< -Wall -Wno-unguarded-availability-new -I$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/include -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -fobjc-runtime=macosx
Xamarin.Mac.registrar.%.a: Xamarin.Mac.registrar.%.i386.a Xamarin.Mac.registrar.%.x86_64.a
$(Q_LIPO) $(DEVICE_BIN_PATH)/lipo -create -output $@ $^
2016-04-25 05:36:52 +03:00
ifdef INCLUDE_MAC
2016-04-21 15:57:02 +03:00
install-local:: $(MMP_TARGETS)
all-local:: $(MMP_TARGETS)
2016-04-25 05:36:52 +03:00
endif
2016-04-21 15:57:02 +03:00
mmp: \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/mmp \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp/mmp.exe \
2016-04-21 15:57:02 +03:00
clean-local::
rm -f mmp.stub.c mmp.helper.o
rm -f bin obj
rm -f Xamarin.Mac.registrar.*
$(SYSTEM_MSBUILD) "/t:Clean" /p:Configuration=$(MMP_CONF) *.csproj
2016-04-21 15:57:02 +03:00
include $(TOP)/mk/rules.mk
include ../common/Make.common
run::
$(Q) make -C tests
# make will automatically consider files created in chained implicit rules as temporary files, and delete them afterwards
# marking those files as .SECONDARY will prevent that deletion.
.SECONDARY: $(foreach ext,h m a,Xamarin.Mac.registrar.mobile.i386.$(ext) Xamarin.Mac.registrar.mobile.x86_64.$(ext) Xamarin.Mac.registrar.full.i386.$(ext) Xamarin.Mac.registrar.full.x86_64.$(ext))
.SECONDARY: Xamarin.Mac.registrar.mobile.a Xamarin.Mac.registrar.full.a