Files
tailscale/kernel/linux/Makefile
T
Brad Fitzpatrick 370c6a69ea kernel/linux/scripts: add build-for-ubuntu.sh and vmtest.sh
build-for-ubuntu.sh builds tswg.ko for a given Ubuntu kernel release in a
private copy of src/, so test builds for different guest kernels don't
share object files with each other or with a developer's in-place build.
The Makefile's SRC is now overridable to allow that.

vmtest.sh runs the tswg natlab vmtests, which live in a tailscale.com
checkout (on the bradfitz/tswg branch) because they use its natlab
framework and the Go tswg netlink client there.

Updates #426

Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: I00eb5cbf8df5a203d6d39d541779060db74da9a1
2026-11-06 21:06:08 +00:00

30 lines
873 B
Makefile

# SPDX-License-Identifier: GPL-2.0
#
# Build tswg.ko out of tree.
#
# make # against the running kernel
# make KDIR=/path/to/build # against another kernel's build dir
# make TSWG_DEBUG=y # enable DEBUG and the built-in selftests
KDIR ?= /lib/modules/$(shell uname -r)/build
# SRC may point at a copy of src/ so that builds for different kernels
# don't share object files.
SRC ?= $(CURDIR)/src
AUTOCONF := $(SRC)/compat/generated/autoconf.h
all: module
# The probes are cheap, so always rerun them; probe.sh leaves the header
# untouched (and so doesn't trigger a rebuild) when the results don't change.
probe:
scripts/probe.sh $(KDIR) $(AUTOCONF)
module: probe
$(MAKE) -C $(KDIR) M=$(SRC) TSWG_DEBUG=$(TSWG_DEBUG) modules
clean:
$(MAKE) -C $(KDIR) M=$(SRC) clean
rm -rf $(SRC)/compat/generated
.PHONY: all probe module clean