This repository was archived by the owner on Feb 21, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (64 loc) · 3.14 KB
/
Makefile
File metadata and controls
75 lines (64 loc) · 3.14 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
current_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
PREFIX ?= /usr/local
DESTDIR ?=
HIPARCH := gfx1201,gfx1100,gfx1101,gfx1102,gfx1103,gfx1151,gfx1012,gfx1030,gfx1031,gfx1032,gfx906,gfx801,gfx802,gfx803
ifeq ($(OS),Windows_NT)
dllend := .dll
exeend := .exe
fpiccuda :=
fpicamd :=
plugin_install_path := $(APPDATA)\VapourSynth\plugins64
exe_install_path := $(ProgramFiles)\FFVship.exe
ffvshiplibheader := -lffms2 -llibvship
ffvshipincludeheader := -I include
fatbincompressamd :=
fatbincompresscuda :=
else
dllend := .so
exeend :=
fpiccuda := -Xcompiler -fPIC
fpicamd := -fPIC
plugin_install_path := $(DESTDIR)$(PREFIX)/lib/vapoursynth
lib_install_path := $(DESTDIR)$(PREFIX)/lib
exe_install_path := $(DESTDIR)$(PREFIX)/bin
header_install_path := $(DESTDIR)$(PREFIX)/include
ffvshiplibheader := $(shell pkg-config --libs ffms2) -lvship
ffvshipincludeheader := $(shell pkg-config --cflags-only-I ffms2 libavutil)
fatbincompressamd :=
fatbincompresscuda :=
endif
.FORCE:
buildFFVSHIP: src/FFVship.cpp .FORCE
clang++ src/FFVship.cpp -g -std=c++17 -Wall -O3 $(ffvshipincludeheader) -L ./ $(ffvshiplibheader) -o FFVship$(exeend)
build: src/VshipLib.cpp .FORCE
hipcc src/VshipLib.cpp -g -std=c++17 -Wall -Wno-ignored-attributes -I "$(current_dir)include" --offload-arch=native -shared $(fpicamd) -o "$(current_dir)libvship$(dllend)"
buildcuda: src/VshipLib.cpp .FORCE
nvcc -x cu src/VshipLib.cpp -g -std=c++17 -I "$(current_dir)include" -arch=native -shared $(fpiccuda) -o "$(current_dir)libvship$(dllend)"
buildcudaall: src/VshipLib.cpp .FORCE
nvcc -x cu src/VshipLib.cpp -g -std=c++17 -I "$(current_dir)include" $(fatbincompresscuda) -arch=all -shared $(fpiccuda) -o "$(current_dir)libvship$(dllend)"
buildall: src/VshipLib.cpp .FORCE
hipcc src/VshipLib.cpp -g -std=c++17 -Wall -Wno-ignored-attributes -I "$(current_dir)include" $(fatbincompressamd) --offload-arch=$(HIPARCH) -shared $(fpicamd) -o "$(current_dir)libvship$(dllend)"
ifeq ($(OS),Windows_NT)
install:
if exist "$(current_dir)libvship$(dllend)" copy "$(current_dir)libvship$(dllend)" "$(plugin_install_path)"
else
install:
@if [ -f "$(current_dir)libvship$(dllend)" ]; then \
install -d "$(plugin_install_path)"; \
install -d "$(header_install_path)"; \
install -m755 "$(current_dir)libvship$(dllend)" "$(lib_install_path)/libvship$(dllend)"; \
ln -sf "../libvship$(dllend)" "$(plugin_install_path)/libvship$(dllend)"; \
install -m755 "$(current_dir)src/VshipAPI.h" "$(header_install_path)/VshipAPI.h"; \
install -m755 "$(current_dir)src/VshipColor.h" "$(header_install_path)/VshipColor.h"; \
fi
@if [ -f "FFVship" ]; then \
install -d "$(exe_install_path)"; \
install -m755 FFVship "$(exe_install_path)/FFVship"; \
fi
uninstall:
rm -f "$(plugin_install_path)/libvship$(dllend)" "$(lib_install_path)/libvship$(dllend)" "$(header_install_path)/VshipAPI.h" "$(header_install_path)/VshipColor.h" "$(exe_install_path)/FFVship"
uninstallOld:
rm -f "$(plugin_install_path)/vship$(dllend)" "$(lib_install_path)/vship$(dllend)" "$(header_install_path)/VshipAPI.h" "$(exe_install_path)/FFVship"
endif
test: .FORCE build
vspipe ./test/vsscript.vpy .