2017-02-22 20:58:14 +03:00
#
2018-08-23 14:27:09 +03:00
# Generator
2017-02-22 20:58:14 +03:00
#
2020-04-08 17:59:17 +03:00
# 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) $< $@
2017-02-22 20:58:14 +03:00
2020-04-08 17:59:17 +03:00
# generator.csproj.inc contains the generator_dependencies variable used to determine if the generator needs to be rebuilt or not.
2018-08-27 17:46:01 +03:00
- i n c l u d e $( BUILD_DIR ) / g e n e r a t o r . c s p r o j . i n c
2017-02-22 20:58:48 +03:00
2018-08-27 17:46:01 +03:00
$(BUILD_DIR)/common/bgen.exe : $( generator_dependencies ) Makefile .generator $( BUILD_DIR ) /generator -frameworks .g .cs
2019-05-27 14:34:36 +03:00
$( Q_GEN) $( SYSTEM_MSBUILD) $( XBUILD_VERBOSITY) /p:Configuration= Debug generator.csproj /p:IntermediateOutputPath= $( BUILD_DIR) /IDE/obj/common/ /p:OutputPath= $( BUILD_DIR) /common
2017-03-23 16:25:37 +03:00
2020-09-21 14:22:44 +03:00
$(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) /
2020-03-16 11:48:52 +03:00
$( Q) $( CP) $( DOTNET_BUILD_DIR) /IDE/bin/common/bgen* $( dir $@ )
2020-09-21 14:22:44 +03:00
$( Q) printf 'exec $(DOTNET5) "$$(dirname "$$0")"/bgen.dll $$@\n' > $@
$( Q) chmod +x $@
2020-02-27 18:04:24 +03:00
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) $< $@
2020-02-27 18:04:24 +03:00
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) \
2020-02-27 18:04:24 +03:00
DOTNET_TARGETS_DIRS += \
2020-02-27 21:21:34 +03:00
$( DOTNET_BUILD_DIR) \
2020-02-27 18:04:24 +03:00
$( 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) \
2020-02-27 18:04:24 +03:00
2017-02-13 20:01:16 +03:00
#
# Common
#
2018-02-09 15:07:22 +03:00
$(BUILD_DIR)/generator-frameworks.g.cs : frameworks .sources Makefile .generator generate -frameworks .csharp
2017-02-22 20:58:14 +03:00
@mkdir -p $( dir $@ )
2017-02-13 20:01:16 +03:00
@./generate-frameworks.csharp '$(IOS_FRAMEWORKS)' '$(MAC_FRAMEWORKS)' '$(WATCHOS_FRAMEWORKS)' '$(TVOS_FRAMEWORKS)' > $@
2020-02-27 21:21:34 +03:00
$(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 \
2017-03-06 19:22:08 +03:00
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /lib/bgen \
2016-04-21 15:30:02 +03:00
2017-03-06 19:22:08 +03:00
IOS_TARGETS += \
2017-03-06 19:25:34 +03:00
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /lib/bgen/Xamarin.iOS.BindingAttributes.dll \
2017-03-06 19:22:08 +03:00
$( 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 \
2020-02-25 13:23:55 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/bgen : bgen /bgen | $( IOS_DESTDIR ) $( MONOTOUCH_PREFIX ) /bin
2019-12-10 14:47:30 +03:00
$( Q) $( CP) $< $@
2017-03-06 19:22:08 +03:00
2019-12-10 14:47:30 +03:00
$(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" > $@
2017-03-06 19:22:08 +03:00
$( Q) chmod +x $@
2019-12-10 14:47:30 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/btouch-native : btouch -native | $( IOS_DESTDIR ) $( MONOTOUCH_PREFIX ) /bin
$( Q) $( CP) $< $@
2017-03-06 19:22:08 +03:00
2017-03-06 19:25:34 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/%.dll : $( IOS_BUILD_DIR ) /native /%.dll | $( IOS_DESTDIR ) $( MONOTOUCH_PREFIX ) /lib /bgen
$( Q) install -m 0755 $< $@
2018-04-18 12:17:00 +03:00
$( Q) install -m 0644 $( <:.dll= .pdb) $( @:.dll= .pdb)
2017-03-06 19:25:34 +03:00
2018-02-09 15:07:22 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/bgen.exe : $( BUILD_DIR ) /common /bgen .exe | $( IOS_DESTDIR ) $( MONOTOUCH_PREFIX ) /lib /bgen
2017-03-06 19:22:08 +03:00
$( 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
2018-02-05 18:26:29 +03:00
$(IOS_BUILD_DIR)/native/Xamarin.iOS.BindingAttributes.dll : generator -attributes .cs Makefile .generator
2017-03-06 19:25:34 +03:00
$( Q) mkdir -p $( dir $@ )
2020-01-02 21:57:22 +03:00
$( Q_GEN) $( SYSTEM_CSC) -features:strict -nologo -out:$@ -debug generator-attributes.cs -target:library -deterministic
2017-03-06 19:25:34 +03:00
2016-04-21 15:30:02 +03:00
#
# Xamarin.Watch (bwatch)
#
WATCH_TARGETS_DIRS += \
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /lib/bwatch \
2017-03-06 19:25:34 +03:00
WATCH_TARGETS += \
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /lib/bgen/Xamarin.WatchOS.BindingAttributes.dll \
2017-03-06 19:22:08 +03:00
WATCH_TARGETS += \
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /bin/bwatch \
2019-12-10 14:47:30 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/bwatch : bwatch | $( IOS_DESTDIR ) $( MONOTOUCH_PREFIX ) /bin
$( Q) $( CP) $< $@
2016-04-21 15:30:02 +03:00
2017-03-06 19:25:34 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/%.dll : $( WATCH_BUILD_DIR ) /%.dll | $( IOS_DESTDIR ) $( MONOTOUCH_PREFIX ) /lib /bgen
$( Q) install -m 0755 $< $@
2018-04-18 12:17:00 +03:00
$( Q) install -m 0644 $( <:.dll= .pdb) $( @:.dll= .pdb)
2017-03-06 19:25:34 +03:00
2018-02-05 18:26:29 +03:00
$(WATCH_BUILD_DIR)/Xamarin.WatchOS.BindingAttributes.dll : generator -attributes .cs Makefile .generator
2017-03-06 19:25:34 +03:00
$( Q) mkdir -p $( dir $@ )
2020-01-02 21:57:22 +03:00
$( Q_GEN) $( SYSTEM_CSC) -features:strict -nologo -debug -out:$@ -debug generator-attributes.cs -target:library -deterministic
2017-03-06 19:22:08 +03:00
2016-04-21 15:30:02 +03:00
# #
# # Xamarin.TVOS (btv)
# #
TVOS_TARGETS_DIRS += \
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /lib/btv \
2017-03-06 19:25:34 +03:00
TVOS_TARGETS += \
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /lib/bgen/Xamarin.TVOS.BindingAttributes.dll \
2017-03-06 19:22:08 +03:00
TVOS_TARGETS += \
2016-04-21 15:30:02 +03:00
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /bin/btv \
2019-12-10 14:47:30 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/btv : btv | $( IOS_DESTDIR ) $( MONOTOUCH_PREFIX ) /bin
$( Q) $( CP) $< $@
2016-04-21 15:30:02 +03:00
2017-03-06 19:25:34 +03:00
$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/bgen/%.dll : $( TVOS_BUILD_DIR ) /%.dll | $( IOS_DESTDIR ) $( MONOTOUCH_PREFIX ) /lib /bgen
$( Q) install -m 0755 $< $@
2018-04-18 12:17:00 +03:00
$( Q) install -m 0644 $( <:.dll= .pdb) $( @:.dll= .pdb)
2017-03-06 19:25:34 +03:00
2018-02-05 18:26:29 +03:00
$(TVOS_BUILD_DIR)/Xamarin.TVOS.BindingAttributes.dll : generator -attributes .cs Makefile .generator
2017-03-06 19:25:34 +03:00
$( Q) mkdir -p $( dir $@ )
2020-01-02 21:57:22 +03:00
$( Q_GEN) $( SYSTEM_CSC) -features:strict -nologo -debug -out:$@ -debug generator-attributes.cs -target:library -deterministic
2017-03-06 19:25:34 +03:00
2016-04-21 15:30:02 +03:00
#
# Xamarin.Mac (bmac)
#
MAC_TARGETS_DIRS += \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /lib/bmac \
2017-03-06 19:22:08 +03:00
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /lib/bgen \
2016-04-21 15:30:02 +03:00
2017-03-06 19:22:08 +03:00
MAC_TARGETS += \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /bin/bgen \
2018-01-04 00:41:49 +03:00
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /bin/bgen-classic \
2017-03-06 19:22:08 +03:00
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /lib/bgen/bgen.exe \
2017-03-06 19:25:34 +03:00
$( 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 \
2017-03-06 19:22:08 +03:00
MAC_TARGETS += \
$( MAC_DESTDIR) $( MAC_FRAMEWORK_CURRENT_DIR) /bin/bmac \
2020-02-25 13:23:55 +03:00
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen : bgen /bgen | $( MAC_DESTDIR ) $( MAC_FRAMEWORK_CURRENT_DIR ) /bin
2019-12-10 14:47:30 +03:00
$( Q) $( CP) $< $@
2016-04-21 15:30:02 +03:00
2019-12-10 14:47:30 +03:00
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/bgen-classic : Makefile .generator | $( MAC_DESTDIR ) $( MAC_FRAMEWORK_CURRENT_DIR ) /bin
2019-07-15 20:19:24 +03:00
$( 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" > $@
2018-01-04 00:41:49 +03:00
$( Q) chmod +x $@
2017-03-06 19:22:08 +03:00
$(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 $< $@
2017-03-06 19:25:34 +03:00
$(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 $< $@
2018-04-21 00:59:09 +03:00
$(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 $< $@
2017-03-06 19:25:34 +03:00
2018-02-09 15:07:22 +03:00
$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/bgen/%.exe : $( BUILD_DIR ) /common /bgen .exe | $( MAC_DESTDIR ) $( MAC_FRAMEWORK_CURRENT_DIR ) /lib /bgen
2017-03-06 19:22:08 +03:00
$( Q) install -m 0755 $< $@
2017-04-12 18:42:17 +03:00
$( Q) install -m 0644 $< $( @:.exe= .pdb)
2017-03-06 19:25:34 +03:00
2018-02-05 18:26:29 +03:00
$(MAC_BUILD_DIR)/Xamarin.Mac-%.BindingAttributes.dll : generator -attributes .cs Makefile .generator
2017-03-06 19:25:34 +03:00
$( Q) mkdir -p $( dir $@ )
2020-01-02 21:57:22 +03:00
$( Q_GEN) $( SYSTEM_CSC) -features:strict -nologo -debug -out:$@ -debug generator-attributes.cs -target:library -deterministic
2017-07-03 15:40:50 +03:00
2019-12-10 14:47:30 +03:00
install-bgen : \
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 \
2017-07-03 15:40:50 +03:00
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /lib/bgen/Xamarin.iOS.BindingAttributes.dll \
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 \
2017-07-03 15:40:50 +03:00
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /lib/bgen/bgen.exe \
$( IOS_DESTDIR) $( MONOTOUCH_PREFIX) /bin/bgen \