xamarin-macios/src/Makefile.generator

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

#
# Generator
#
# copy generator.csproj to the build dir so that we can use our shared .csproj.inc target from rules.mk to create generator.csproj.inc
# we need any generated files in this directory to go into the build directory, and the shared target will output the csproj.inc into the same directory as the csproj
$(BUILD_DIR)/generator.csproj: generator.csproj | $(BUILD_DIR)
$(Q) $(CP) $< $@
# generator.csproj.inc contains the generator_dependencies variable used to determine if the generator needs to be rebuilt or not.
-include $(BUILD_DIR)/generator.csproj.inc
$(BUILD_DIR)/common/bgen.exe: $(generator_dependencies) Makefile.generator $(BUILD_DIR)/generator-frameworks.g.cs
$(Q_GEN) $(SYSTEM_MSBUILD) $(XBUILD_VERBOSITY) /p:Configuration=Debug generator.csproj /p:IntermediateOutputPath=$(BUILD_DIR)/IDE/obj/common/ /p:OutputPath=$(BUILD_DIR)/common
$(DOTNET_BUILD_DIR)/bgen/bgen: $(generator_dependencies) Makefile.generator $(BUILD_DIR)/generator-frameworks.g.cs global.json | $(DOTNET_BUILD_DIR)/bgen
$(Q_DOTNET_BUILD) $(DOTNET5) publish $(XBUILD_VERBOSITY) /p:Configuration=Debug bgen/bgen.csproj /p:IntermediateOutputPath=$(abspath $(DOTNET_BUILD_DIR)/IDE/obj/common)/ /p:OutputPath=$(abspath $(DOTNET_BUILD_DIR)/IDE/bin/common)/
$(Q) $(CP) $(DOTNET_BUILD_DIR)/IDE/bin/common/bgen* $(dir $@)
$(Q) printf 'exec $(DOTNET5) "$$(dirname "$$0")"/bgen.dll $$@\n' > $@
$(Q) chmod +x $@
2020-07-01 21:01:29 +03:00
$(DOTNET_DESTDIR)/%.Sdk/tools/lib/bgen/bgen: $(DOTNET_BUILD_DIR)/bgen/bgen | $(DOTNET_DESTDIR)/%.Sdk/tools/lib/bgen
$(Q) rm -f $(dir $@)/bgen*
$(Q) $(CP) $<* $(dir $@)
$(DOTNET_DESTDIR)/%.Sdk/tools/bin/bgen: bgen/bgen.dotnet | $(DOTNET_DESTDIR)/%.Sdk/tools/bin
$(Q) $(CP) $< $@
$(DOTNET_DESTDIR)/%.Sdk/tools/lib/Xamarin.Apple.BindingAttributes.dll: $(DOTNET_BUILD_DIR)/Xamarin.Apple.BindingAttributes.dll | $(DOTNET_DESTDIR)/%.Sdk/tools/lib
$(Q) $(CP) $< $@
DOTNET_TARGETS += \
$(DOTNET_BUILD_DIR)/bgen/bgen \
2020-07-01 21:01:29 +03:00
$(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/bin/bgen) \
$(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/lib/bgen/bgen) \
$(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/lib/Xamarin.Apple.BindingAttributes.dll) \
DOTNET_TARGETS_DIRS += \
$(DOTNET_BUILD_DIR) \
$(DOTNET_BUILD_DIR)/bgen \
2020-07-01 21:01:29 +03:00
$(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/bin) \
$(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/lib) \
$(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/lib/bgen) \
#
# Common
#
$(BUILD_DIR)/generator-frameworks.g.cs: frameworks.sources Makefile.generator generate-frameworks.csharp
@mkdir -p $(dir $@)
@./generate-frameworks.csharp '$(IOS_FRAMEWORKS)' '$(MAC_FRAMEWORKS)' '$(WATCHOS_FRAMEWORKS)' '$(TVOS_FRAMEWORKS)' > $@
$(DOTNET_BUILD_DIR)/Xamarin.Apple.BindingAttributes.dll: generator-attributes.cs Makefile.generator | $(DOTNET_BUILD_DIR)
$(Q_DOTNET_BUILD) $(SYSTEM_CSC) $(DOTNET_FLAGS) -out:$@ $<
2016-04-21 15:30:02 +03:00
#
# Xamarin.iOS (btouch)
#
IOS_TARGETS_DIRS += \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/btouch \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen \
2016-04-21 15:30:02 +03:00
IOS_TARGETS += \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/Xamarin.iOS.BindingAttributes.dll \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/bgen.exe \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/bgen \
IOS_TARGETS += \
2016-04-21 15:30:02 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/btouch \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/btouch-native \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/bgen: bgen/bgen | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin
$(Q) $(CP) $< $@
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/btouch: Makefile.generator | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin
$(Q_GEN) printf "#!/bin/sh -e\n\necho \"error BI0088: btouch: MonoTouch binding projects are not supported anymore. Please upgrade the binding project to a Xamarin.iOS (Unified) binding project.\"\nexit 1\n" > $@
$(Q) chmod +x $@
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/btouch-native: btouch-native | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin
$(Q) $(CP) $< $@
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/%.dll: $(IOS_BUILD_DIR)/native/%.dll | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen
$(Q) install -m 0755 $< $@
$(Q) install -m 0644 $(<:.dll=.pdb) $(@:.dll=.pdb)
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/bgen.exe: $(BUILD_DIR)/common/bgen.exe | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen
$(Q) install -m 0755 $< $@
2017-04-12 18:42:17 +03:00
$(Q) install -m 0644 $< $(@:.exe=.pdb)
2016-04-21 15:30:02 +03:00
$(IOS_BUILD_DIR)/native/Xamarin.iOS.BindingAttributes.dll: generator-attributes.cs Makefile.generator
$(Q) mkdir -p $(dir $@)
$(Q_GEN) $(SYSTEM_CSC) -features:strict -nologo -out:$@ -debug generator-attributes.cs -target:library -deterministic
2016-04-21 15:30:02 +03:00
#
# Xamarin.Watch (bwatch)
#
WATCH_TARGETS_DIRS += \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bwatch \
WATCH_TARGETS += \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/Xamarin.WatchOS.BindingAttributes.dll \
WATCH_TARGETS += \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/bwatch \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/bwatch: bwatch | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin
$(Q) $(CP) $< $@
2016-04-21 15:30:02 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/%.dll: $(WATCH_BUILD_DIR)/%.dll | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen
$(Q) install -m 0755 $< $@
$(Q) install -m 0644 $(<:.dll=.pdb) $(@:.dll=.pdb)
$(WATCH_BUILD_DIR)/Xamarin.WatchOS.BindingAttributes.dll: generator-attributes.cs Makefile.generator
$(Q) mkdir -p $(dir $@)
$(Q_GEN) $(SYSTEM_CSC) -features:strict -nologo -debug -out:$@ -debug generator-attributes.cs -target:library -deterministic
2016-04-21 15:30:02 +03:00
# #
# # Xamarin.TVOS (btv)
# #
TVOS_TARGETS_DIRS += \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/btv \
TVOS_TARGETS += \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/Xamarin.TVOS.BindingAttributes.dll \
TVOS_TARGETS += \
2016-04-21 15:30:02 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/btv \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/btv: btv | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin
$(Q) $(CP) $< $@
2016-04-21 15:30:02 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/%.dll: $(TVOS_BUILD_DIR)/%.dll | $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen
$(Q) install -m 0755 $< $@
$(Q) install -m 0644 $(<:.dll=.pdb) $(@:.dll=.pdb)
$(TVOS_BUILD_DIR)/Xamarin.TVOS.BindingAttributes.dll: generator-attributes.cs Makefile.generator
$(Q) mkdir -p $(dir $@)
$(Q_GEN) $(SYSTEM_CSC) -features:strict -nologo -debug -out:$@ -debug generator-attributes.cs -target:library -deterministic
2016-04-21 15:30:02 +03:00
#
# Xamarin.Mac (bmac)
#
MAC_TARGETS_DIRS += \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bmac \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen \
2016-04-21 15:30:02 +03:00
MAC_TARGETS += \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen-classic \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/bgen.exe \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/Xamarin.Mac-full.BindingAttributes.dll \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/Xamarin.Mac-mobile.BindingAttributes.dll \
MAC_TARGETS += \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bmac \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen: bgen/bgen | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin
$(Q) $(CP) $< $@
2016-04-21 15:30:02 +03:00
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen-classic: Makefile.generator | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin
$(Q_GEN) printf "#!/bin/sh -e\n\necho \"error BI0087: bgen-classic: Xamarin.Mac Classic binding projects are not supported anymore. Please upgrade the binding project to a Xamarin.Mac Unified binding project.\"\nexit 1\n" > $@
$(Q) chmod +x $@
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bmac: bmac.ikvm | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin
2016-04-21 15:30:02 +03:00
$(Q) install -m 0755 $< $@
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/%.dll: $(MAC_BUILD_DIR)/%.dll | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen
$(Q) install -m 0755 $< $@
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/%.pdb: $(MAC_BUILD_DIR)/%.pdb | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen
$(Q) install -m 0644 $< $@
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/%.mdb: $(MAC_BUILD_DIR)/%.mdb | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen
$(Q) install -m 0644 $< $@
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/%.exe: $(BUILD_DIR)/common/bgen.exe | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen
$(Q) install -m 0755 $< $@
2017-04-12 18:42:17 +03:00
$(Q) install -m 0644 $< $(@:.exe=.pdb)
$(MAC_BUILD_DIR)/Xamarin.Mac-%.BindingAttributes.dll: generator-attributes.cs Makefile.generator
$(Q) mkdir -p $(dir $@)
$(Q_GEN) $(SYSTEM_CSC) -features:strict -nologo -debug -out:$@ -debug generator-attributes.cs -target:library -deterministic
install-bgen: \
[tests] Port the makefile-based generator tests to NUnit. (#3019) * [tests][generator] Port bindas1048error to NUnit. * [tests][generator] Port bindas1049error to NUnit. * [tests][generator] Port bindas1050modelerror to NUnit. * [tests][generator] Port bindas1050protocolerror to NUnit. * [tests][generator] Port bug42855 to NUnit. * [tests][generator] Port bug57070 to NUnit. * [tests][generator] Port bug52570classinternal to NUnit. * [tests][generator] Port bug52570methodinternal to NUnit. * [tests][generator] Port bug52570allowstaticmembers to NUnit. * [tests][generator] Port protocol-duplicate-abstract-error to NUnit. * [tests][generator] Port protocol-duplicate-method-diff-length to NUnit. * [tests][generator] Port protocol-duplicate-method-diff-out to NUnit. * [tests][generator] Port protocol-duplicate-method-diff-type to NUnit. * [tests][generator] Port protocol-duplicate-method-diff-return to NUnit. * [tests][generator] Port warnaserror to NUnit. * [tests][generator] Port nowarn to NUnit. * [tests][generator] Add support for inspecting/asserting the generated content. * [tests][generator] Port some Xamarin.Mac tests to NUnit. Ported: * bmac_smoke * bmac-with-hyphen-in-name * property-redefination-mac * NSApplicationPublicEnsureMethods * protocol-duplicate-abstract * [tests][generator] Point bgen to our local installation. * [tests][generator] Port the bug31788 test to a unit test. * [generator] Make the 'bgen' helper target more complete. * [tests][generator] Port non-custom iOS tests to unit tests. * [tests][generator] Add new test. * [tests][generator] Port the forum54078 test to a unit test. * [tests][generator] Port the desk63279 test to a unit test. * [tests][generator] Port the desk79124 test to a unit test. * [tests][generator] Port the multiple-api-definitions tests to unit tests. * [generator] Use mono code style. * [tests][generator] Port the bug29493 test to a unit test. * [tests][generator] Port the classNameCollision test to a unit test. * [tests][generator] Port the bi1036 test to a unit test. * [tests][generator] Port the bug37527 test to a unit test. Also fix BI1112 and BI1113 to show up as errors in the console output (since they're exceptions they're already treated as errors and would cause bgen to fail). * [tests][generator] Port the bug27986 test to a unit test. * [tests][generator] Port the bug35176 test to a unit test. * [tests][generator] Port the bi1046 test to a unit test. * [tests][generator] Port the virtualwrap test to a unit test. * [tests][generator] Port the bug42742 test to a unit test. * [tests][generator] Port the noasyncinternalwrapper test to a unit test. * [tests][generator] Port the noasyncwarningcs0219 test to a unit test. * [tests][generator] Port the bug53076 test to a unit test. * [tests][generator] Port the bug53076withmodel test to a unit test. * [tests][generator] Port the fieldenumtests test to a unit test. * [tests][generator] Port the smartenumwithframework test to a unit test. * [tests][generator] Port the forcedtype test to a unit test. * [tests][generator] Port the bug46292 test to a unit test. * [tests][generator] Build tests with MSBuild. There's no need to use xbuild for these tests. * [tests][generator] Remove dead code. * [xharness] Don't run the makefile-based generator tests anymore. Since there aren't any makefile-based generator tests anymore, they've all been ported to NUnit tests. * [tests][generator] Make the bug39614 test do what it was supposed to do: make sure a namespace isn't required (but recommended).
2017-11-20 16:55:16 +03:00
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/bgen.exe \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/Xamarin.Mac-full.BindingAttributes.dll \
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/Xamarin.Mac-mobile.BindingAttributes.dll \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/Xamarin.iOS.BindingAttributes.dll \
[tests] Port the makefile-based generator tests to NUnit. (#3019) * [tests][generator] Port bindas1048error to NUnit. * [tests][generator] Port bindas1049error to NUnit. * [tests][generator] Port bindas1050modelerror to NUnit. * [tests][generator] Port bindas1050protocolerror to NUnit. * [tests][generator] Port bug42855 to NUnit. * [tests][generator] Port bug57070 to NUnit. * [tests][generator] Port bug52570classinternal to NUnit. * [tests][generator] Port bug52570methodinternal to NUnit. * [tests][generator] Port bug52570allowstaticmembers to NUnit. * [tests][generator] Port protocol-duplicate-abstract-error to NUnit. * [tests][generator] Port protocol-duplicate-method-diff-length to NUnit. * [tests][generator] Port protocol-duplicate-method-diff-out to NUnit. * [tests][generator] Port protocol-duplicate-method-diff-type to NUnit. * [tests][generator] Port protocol-duplicate-method-diff-return to NUnit. * [tests][generator] Port warnaserror to NUnit. * [tests][generator] Port nowarn to NUnit. * [tests][generator] Add support for inspecting/asserting the generated content. * [tests][generator] Port some Xamarin.Mac tests to NUnit. Ported: * bmac_smoke * bmac-with-hyphen-in-name * property-redefination-mac * NSApplicationPublicEnsureMethods * protocol-duplicate-abstract * [tests][generator] Point bgen to our local installation. * [tests][generator] Port the bug31788 test to a unit test. * [generator] Make the 'bgen' helper target more complete. * [tests][generator] Port non-custom iOS tests to unit tests. * [tests][generator] Add new test. * [tests][generator] Port the forum54078 test to a unit test. * [tests][generator] Port the desk63279 test to a unit test. * [tests][generator] Port the desk79124 test to a unit test. * [tests][generator] Port the multiple-api-definitions tests to unit tests. * [generator] Use mono code style. * [tests][generator] Port the bug29493 test to a unit test. * [tests][generator] Port the classNameCollision test to a unit test. * [tests][generator] Port the bi1036 test to a unit test. * [tests][generator] Port the bug37527 test to a unit test. Also fix BI1112 and BI1113 to show up as errors in the console output (since they're exceptions they're already treated as errors and would cause bgen to fail). * [tests][generator] Port the bug27986 test to a unit test. * [tests][generator] Port the bug35176 test to a unit test. * [tests][generator] Port the bi1046 test to a unit test. * [tests][generator] Port the virtualwrap test to a unit test. * [tests][generator] Port the bug42742 test to a unit test. * [tests][generator] Port the noasyncinternalwrapper test to a unit test. * [tests][generator] Port the noasyncwarningcs0219 test to a unit test. * [tests][generator] Port the bug53076 test to a unit test. * [tests][generator] Port the bug53076withmodel test to a unit test. * [tests][generator] Port the fieldenumtests test to a unit test. * [tests][generator] Port the smartenumwithframework test to a unit test. * [tests][generator] Port the forcedtype test to a unit test. * [tests][generator] Port the bug46292 test to a unit test. * [tests][generator] Build tests with MSBuild. There's no need to use xbuild for these tests. * [tests][generator] Remove dead code. * [xharness] Don't run the makefile-based generator tests anymore. Since there aren't any makefile-based generator tests anymore, they've all been ported to NUnit tests. * [tests][generator] Make the bug39614 test do what it was supposed to do: make sure a namespace isn't required (but recommended).
2017-11-20 16:55:16 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/Xamarin.TVOS.BindingAttributes.dll \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/Xamarin.WatchOS.BindingAttributes.dll \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/bgen.exe \
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/bgen \