-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
46 lines (36 loc) · 1.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# SPDX-FileCopyrightText: © 2024 Tenstorrent Inc.
# SPDX-License-Identifier: GPL-2.0-only
obj-m += tenstorrent.o
tenstorrent-y := module.o chardev.o enumerate.o interrupt.o grayskull.o wormhole.o pcie.o hwmon.o sg_helpers.o memory.o
KDIR := /lib/modules/$(shell uname -r)/build
KMAKE := $(MAKE) -C $(KDIR) M=$(CURDIR)
.PHONY: all
all: modules
.PHONY: modules
modules:
+$(KMAKE) modules
.PHONY: modules_install
modules_install:
+$(KMAKE) modules_install
.PHONY: clean
clean:
+$(KMAKE) clean
.PHONY: help
help:
+$(KMAKE) help
# Helper for running the driver tests in a VM.
# Supposed to be paired with https://github.com/TTDRosen/qemu-utils
# make TT_QEMU_ARCH=x86_64
.PHONY: qemu-build
qemu-build:
rsync --exclude=.git -r -e 'ssh -p 10022' ../tt-kmd [email protected]:
ssh -p 10022 [email protected] "cd tt-kmd && make && (sudo rmmod tenstorrent.ko || true) && sudo insmod tenstorrent.ko && sudo dmesg"
ssh -p 10022 [email protected] "cd tt-kmd && make -C test && sudo ./test/ttkmd_test --skip-aer"
ifeq ($(VER),HEAD)
ARCHIVE_TAG_NAME=HEAD
else
ARCHIVE_TAG_NAME=ttdriver-$(VER)
endif
.PHONY: archive
archive:
git archive --prefix=ttdriver/ -o ttdriver-$(VER).tar.gz $(ARCHIVE_TAG_NAME):$(shell git rev-parse --show-prefix)