Repository navigation
Expand file tree
/
Copy pathMakefile.in
More file actions
116 lines (94 loc) · 4.59 KB
/
Copy pathMakefile.in
File metadata and controls
116 lines (94 loc) · 4.59 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
include config.mk
.PHONY: third_party hardware software tests
all: third_party hardware software tests
third_party:
$(MAKE) -C $(VORTEX_HOME)/third_party
hardware: third_party
$(MAKE) -C hw
$(MAKE) -C sim
software: third_party
$(MAKE) -C sw/kernel
$(MAKE) -C sw/runtime/stub
tests: software hardware
$(MAKE) -C tests
clean:
$(MAKE) -C sw clean
$(MAKE) -C hw clean
$(MAKE) -C sim clean
$(MAKE) -C tests clean
clean-all: clean
$(MAKE) -C $(VORTEX_HOME)/third_party clean
# Install layout — mirrors the CUDA / ROCm / oneAPI SDK pattern so
# downstream consumers (mesa, pocl, chipstar) integrate via a single
# $VORTEX_PATH env var + pkg-config discovery. Source-tree paths
# ($VORTEX_HOME, $VORTEX_BUILD_DIR) never leak to consumers.
#
# $INSTALLDIR/
# ├── kernel/include/ ← public device-side headers (vx_*.h)
# │ └── VX_types.h (generated, copied from $BUILDDIR/sw/)
# ├── kernel/lib<XLEN>/ ← libvx_runtime.a (per-XLEN)
# ├── runtime/include/ ← public host-side headers (vortex.h, vortex2.h,
# │ graphics.h, tensor.h, dxa.h)
# ├── runtime/lib/ ← libvortex.so + libvortex-{simx,xrt,rtlsim,opae}.so
# └── lib/pkgconfig/ ← vortex-runtime.pc + vortex-kernel.pc
KERNEL_INC_DST = $(INSTALLDIR)/kernel/include
KERNEL_LIB_DST = $(INSTALLDIR)/kernel/lib$(XLEN)
RUNTIME_INC_DST = $(INSTALLDIR)/runtime/include
RUNTIME_LIB_DST = $(INSTALLDIR)/runtime/lib
PKGCONFIG_DST = $(INSTALLDIR)/lib/pkgconfig
KERNEL_HEADERS = $(wildcard $(VORTEX_HOME)/sw/kernel/include/*.h)
KERNEL_LIBS = $(wildcard sw/kernel/*.a)
RUNTIME_HEADERS = $(wildcard $(VORTEX_HOME)/sw/runtime/include/*.h)
RUNTIME_LIBS = $(wildcard sw/runtime/*.so)
PKGCONFIG_FILES = sw/runtime/vortex-runtime.pc sw/runtime/vortex-kernel.pc
INSTALL_DIRS = $(KERNEL_LIB_DST) $(RUNTIME_LIB_DST) \
$(KERNEL_INC_DST) $(RUNTIME_INC_DST) \
$(PKGCONFIG_DST)
$(INSTALL_DIRS):
mkdir -p $@
# Generated VX_types.h ships in kernel/include alongside the public
# kernel API headers (it's read by both host and device code; the
# kernel-side install path is the canonical home).
$(KERNEL_INC_DST)/VX_types.h: sw/VX_types.h | $(KERNEL_INC_DST)
cp $< $@
# Public-ABI headers that physically live in sw/common/ (vortex-internal, shared
# by sw and sim per the sw/↔sim/+hw/ isolation rule) but ship in the SDK because
# an installed kernel/runtime header pulls them in, or a driver consumes them
# directly:
# tensor_cfg.h via vx_tensor.h / tensor.h
# vx_gfx_abi.h via vx_graphics.h
# gfx_frontend_abi.h on-device setup+binning front-end ABI (vortexpipe launches)
# gfx_dcr.h DCR state-index helpers, via graphics.h
# rtu_cfg.h CW-BVH scene format, via raytrace.h (was a latent break)
# gfx_sw_abi.h C ABI for the on-device SW fallback (libgfx_sw / vortexpipe)
# vx_tex_lod.h quad-LOD SSOT for device kernels doing vx_tex4 quad
# All install to kernel/include so a downstream -I$VORTEX_PATH/kernel/include
# (added by vortex-runtime.pc + vortex-kernel.pc) resolves them. List-driven via a
# static pattern rule so adding a public sw/common header is a one-line edit (and
# can't silently fail to ship). A static pattern rule binds ONLY these targets, so
# it does not collide with the generic kernel/include %.h rule below.
SW_COMMON_PUBLIC := tensor_cfg.h vx_gfx_abi.h gfx_frontend_abi.h gfx_dcr.h \
rtu_cfg.h gfx_sw_abi.h vx_tex_lod.h
SW_COMMON_PUBLIC_DST := $(addprefix $(KERNEL_INC_DST)/,$(SW_COMMON_PUBLIC))
$(SW_COMMON_PUBLIC_DST): $(KERNEL_INC_DST)/%.h: $(VORTEX_HOME)/sw/common/%.h | $(KERNEL_INC_DST)
cp $< $@
$(KERNEL_INC_DST)/%.h: $(VORTEX_HOME)/sw/kernel/include/%.h | $(KERNEL_INC_DST)
cp $< $@
$(RUNTIME_INC_DST)/%.h: $(VORTEX_HOME)/sw/runtime/include/%.h | $(RUNTIME_INC_DST)
cp $< $@
$(KERNEL_LIB_DST)/%.a: sw/kernel/%.a | $(KERNEL_LIB_DST)
cp $< $@
$(RUNTIME_LIB_DST)/%.so: sw/runtime/%.so | $(RUNTIME_LIB_DST)
cp $< $@
# pkg-config descriptors — generated by configure (substituting
# @INSTALLDIR@, @XLEN@, @VORTEX_VERSION@), copied as-is on install.
$(PKGCONFIG_DST)/%.pc: sw/runtime/%.pc | $(PKGCONFIG_DST)
cp $< $@
install: $(INSTALL_DIRS) \
$(KERNEL_INC_DST)/VX_types.h \
$(SW_COMMON_PUBLIC_DST) \
$(KERNEL_HEADERS:$(VORTEX_HOME)/sw/kernel/include/%=$(KERNEL_INC_DST)/%) \
$(RUNTIME_HEADERS:$(VORTEX_HOME)/sw/runtime/include/%=$(RUNTIME_INC_DST)/%) \
$(KERNEL_LIBS:sw/kernel/%=$(KERNEL_LIB_DST)/%) \
$(RUNTIME_LIBS:sw/runtime/%=$(RUNTIME_LIB_DST)/%) \
$(PKGCONFIG_FILES:sw/runtime/%=$(PKGCONFIG_DST)/%)