@ -145,30 +145,15 @@ apk: $(DEBUG_APK)
run : install
run : install
adb shell am start -n com.tailscale.ipn/com.tailscale.ipn.IPNActivity
adb shell am start -n com.tailscale.ipn/com.tailscale.ipn.IPNActivity
GOMOBILE = /tmp/gopath/bin/gomobile
GOBIND = /tmp/gopath/bin/gobind
LIBTAILSCALE = android/libs/libtailscale.aar
LIBTAILSCALE = android/libs/libtailscale.aar
LIBTAILSCALE_SOURCES = $( shell find libtailscale -name *.go) go.mod go.sum
LIBTAILSCALE_SOURCES = $( shell find libtailscale -name *.go) go.mod go.sum
$(GOMOBILE) :
android/libs :
@echo "building gomobile" && \
mkdir -p android/libs
export GOPATH = /tmp/gopath && \
mkdir -p $$ GOPATH && \
$(LIBTAILSCALE) : android /libs $( LIBTAILSCALE_SOURCES )
export PATH = $$ PATH:$$ GOPATH/bin && \
go run golang.org/x/mobile/cmd/gomobile init
go install golang.org/x/mobile/cmd/gomobile@latest
go run golang.org/x/mobile/cmd/gomobile bind -target android -androidapi 26 -o $@ ./libtailscale
$(GOBIND) : $( GOMOBILE )
@export GOPATH = /tmp/gopath && \
$( GOMOBILE) init
gomobile : $( GOBIND )
$(LIBTAILSCALE) : $( LIBTAILSCALE_SOURCES ) $( GOBIND )
@export GOPATH = /tmp/gopath && \
export PATH = $$ PATH:$$ GOPATH/bin && \
$( GOMOBILE) bind -target android -androidapi 26 ./libtailscale && \
mkdir -p android/libs/ && \
cp libtailscale.aar $( LIBTAILSCALE)
libtailscale : $( LIBTAILSCALE )
libtailscale : $( LIBTAILSCALE )