mirror of
https://github.com/Drop-OSS/libtailscale.git
synced 2026-01-30 20:55:18 +01:00
There is a makefile that will produce a libtailscale.tar.zst. This archive contains a vendored Go source tree for libtailscale, and a `configure` and `Makefile` that will produce a .so, a .a, and a .pc file for building & linking against. Updates tailscale/tailscale#8912
31 lines
1000 B
Makefile
31 lines
1000 B
Makefile
# Copyright (c) Tailscale Inc & AUTHORS
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Construct a source package by vendoring all source and packing it up into a
|
|
# tarball.
|
|
|
|
ifeq ($(shell uname -s),Darwin)
|
|
TAR?=gtar
|
|
else
|
|
TAR?=tar
|
|
endif
|
|
|
|
all: check
|
|
|
|
check: libtailscale.tar.zst
|
|
@echo "Checking that the tarball is self-contained..."
|
|
test `$(TAR) tf libtailscale.tar.zst | grep -c -v '^libtailscale/'` -eq 0 || (echo "Tarball is not self-contained!" && exit 1)
|
|
|
|
@tar xf libtailscale.tar.zst
|
|
@echo "Checking that the tarball is usable..."
|
|
@cd libtailscale && ./configure && make
|
|
|
|
|
|
clean:
|
|
rm -rf ./libtailscale.tar.zst ../vendor ./libtailscale
|
|
|
|
../vendor: ../go.mod ../go.sum ../tailscale.go Makefile.src Makefile
|
|
go mod vendor
|
|
|
|
libtailscale.tar.zst: Makefile.src configure ../vendor ../LICENSE ../tailscale.go ../go.mod ../go.sum
|
|
$(TAR) --transform 's#^#libtailscale/#' --transform 's#Makefile.src#Makefile#' -acf $@ Makefile.src configure ../vendor ../LICENSE ../tailscale.go ../go.mod ../go.sum
|