portability/Makefile

130 lines
4.3 KiB
Makefile
Raw Normal View History

2017-09-07 12:01:58 +10:00
VULKAN_DIR=modules/vulkan-docs/src
2018-04-02 11:45:52 +10:00
CTS_DIR=../VK-GL-CTS
2018-04-27 07:55:06 +10:00
CHERRY_DIR=../cherry
2017-09-07 11:34:41 +10:00
BINDING=target/vulkan.rs
NATIVE_DIR=target/native
TARGET=$(NATIVE_DIR)/test
2017-12-08 08:29:14 +11:00
OBJECTS=$(NATIVE_DIR)/test.o $(NATIVE_DIR)/window.o
2018-03-02 14:04:47 +11:00
LIB_EXTENSION=
2018-05-04 11:04:33 +10:00
TEST_LIST=$(CURDIR)/conformance/deqp.txt
TEST_LIST_SOURCE=$(CTS_DIR)/external/vulkancts/mustpass/1.0.2/vk-default.txt
2018-05-04 11:04:33 +10:00
DEQP_DIR=$(CTS_DIR)/build/external/vulkancts/modules/vulkan/
DEQP=cd $(DEQP_DIR) && RUST_LOG=debug LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) ./deqp-vk
2018-06-13 00:59:20 +10:00
DOTA_DIR=../dota2/bin/osx64
DOTA_EXE=$(DOTA_DIR)/dota2.app/Contents/MacOS/dota2
2018-06-30 04:04:11 +10:00
#DOTA_PARAMS=-vulkan_disable_occlusion_queries -vulkan_scene_system_job_cost 2
DOTA_PARAMS=-vulkan_disable_occlusion_queries
2018-03-02 14:04:47 +11:00
RUST_BACKTRACE:=1
BACKEND:=gl
2018-04-19 05:30:31 +10:00
DEBUGGER=rust-gdb --args
2017-12-01 10:50:59 +11:00
CC=g++
2017-12-08 08:29:14 +11:00
CFLAGS=-std=c++11 -ggdb -O0 -I$(VULKAN_DIR)
2017-09-07 12:01:58 +10:00
DEPS=
2018-03-02 14:04:47 +11:00
LDFLAGS=
ifeq ($(OS),Windows_NT)
LDFLAGS=
BACKEND=dx12
LIB_EXTENSION=dll
else
UNAME_S:=$(shell uname -s)
ifeq ($(UNAME_S),Linux)
LDFLAGS=-lpthread -ldl -lm -lX11 -lxcb
BACKEND=vulkan
LIB_EXTENSION=so
endif
ifeq ($(UNAME_S),Darwin)
LDFLAGS=-lpthread -ldl -lm
BACKEND=metal
2018-04-19 05:30:31 +10:00
DEBUGGER=rust-lldb --
2018-03-02 14:04:47 +11:00
LIB_EXTENSION=dylib
endif
endif
2018-04-02 11:45:52 +10:00
FULL_LIBRARY_PATH=$(CURDIR)/target/debug
2018-03-02 14:04:47 +11:00
LIBRARY=target/debug/libportability.$(LIB_EXTENSION)
2018-04-23 06:07:39 +10:00
LIBRARY_FAST=target/release/libportability.$(LIB_EXTENSION)
2017-09-07 12:01:58 +10:00
2018-06-30 04:04:11 +10:00
.PHONY: all rebuild debug release version-debug version-release binding run cts clean cherry dota-debug dota-release dota-orig
2017-09-13 02:27:01 +10:00
2017-09-07 11:34:41 +10:00
all: $(TARGET)
2018-04-27 07:55:06 +10:00
rebuild:
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND)
2018-04-26 02:00:50 +10:00
debug:
2018-06-13 00:59:20 +10:00
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND),debug
release: $(LIBRARY_FAST)
2018-04-26 02:00:50 +10:00
2018-06-25 12:27:10 +10:00
version-debug:
2018-06-13 00:59:20 +10:00
cargo rustc --manifest-path libportability/Cargo.toml --features $(BACKEND),portability-gfx/env_logger -- -Clink-arg="-current_version 1.0.0" -Clink-arg="-compatibility_version 1.0.0"
2018-06-06 12:54:02 +10:00
2018-06-25 12:27:10 +10:00
version-release:
2018-06-13 00:59:20 +10:00
cargo rustc --release --manifest-path libportability/Cargo.toml --features $(BACKEND) -- -Clink-arg="-current_version 1.0.0" -Clink-arg="-compatibility_version 1.0.0"
2018-06-25 12:27:10 +10:00
dota-debug: version-debug $(DOTA_EXE)
2018-06-30 04:04:11 +10:00
echo "env DYLD_LIBRARY_PATH=$(CURDIR)/target/debug:$(CURDIR)/$(DOTA_DIR)" >.lldbinit
DYLD_LIBRARY_PATH=$(CURDIR)/target/debug:$(CURDIR)/$(DOTA_DIR) $(DEBUGGER) $(DOTA_EXE) $(DOTA_PARAMS)
2018-06-13 00:59:20 +10:00
2018-06-25 12:27:10 +10:00
dota-release: version-release $(DOTA_EXE)
2018-06-30 04:04:11 +10:00
DYLD_LIBRARY_PATH=$(CURDIR)/target/release:$(CURDIR)/$(DOTA_DIR) $(DOTA_EXE) $(DOTA_PARAMS)
dota-molten:
DYLD_LIBRARY_PATH=$(CURDIR)/../MoltenVK/Package/Release/MoltenVK/macOS:$(CURDIR)/$(DOTA_DIR) $(DOTA_EXE)
dota-orig:
DYLD_LIBRARY_PATH=$(CURDIR)/$(DOTA_DIR) $(DOTA_EXE)
2018-04-23 06:07:39 +10:00
2017-09-13 02:27:01 +10:00
binding: $(BINDING)
2017-09-07 12:01:58 +10:00
$(BINDING): $(VULKAN_DIR)/vulkan/*.h
bindgen --no-layout-tests --rustfmt-bindings $(VULKAN_DIR)/vulkan/vulkan.h -o $(BINDING)
2018-04-12 23:24:47 +10:00
$(LIBRARY): libportability*/src/*.rs libportability*/Cargo.toml Cargo.lock
2018-03-02 14:04:47 +11:00
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND)
2018-04-12 23:24:47 +10:00
cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND)
2017-09-07 11:34:41 +10:00
mkdir -p target/native
2018-04-23 06:07:39 +10:00
$(LIBRARY_FAST): libportability*/src/*.rs libportability*/Cargo.toml Cargo.lock
cargo build --release --manifest-path libportability/Cargo.toml --features $(BACKEND)
cargo build --release --manifest-path libportability-icd/Cargo.toml --features $(BACKEND)
2017-12-01 10:50:59 +11:00
$(NATIVE_DIR)/%.o: native/%.cpp $(DEPS) Makefile
2017-09-07 11:34:41 +10:00
$(CC) -c -o $@ $< $(CFLAGS)
2017-11-07 13:57:32 +11:00
$(TARGET): $(LIBRARY) $(OBJECTS) Makefile
2017-12-01 10:50:59 +11:00
$(CC) -o $(TARGET) $(OBJECTS) $(LIBRARY) $(LDFLAGS)
2017-09-07 11:34:41 +10:00
run: $(TARGET)
$(TARGET)
$(TEST_LIST): $(TEST_LIST_SOURCE)
cat $(TEST_LIST_SOURCE) | grep -v -e ".event" -e "query" >$(TEST_LIST)
2018-05-31 11:27:34 +10:00
ifdef pick
cts:
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND),portability-gfx/env_logger
($(DEQP) -n $(pick))
else
ifdef debug
cts: $(LIBRARY)
2018-06-30 04:04:11 +10:00
echo "env LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH)" >.lldbinit
2018-05-31 11:27:34 +10:00
#(cd $(DEQP_DIR) && LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) $(DEBUGGER) ./deqp-vk -n $(debug))
LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) $(DEBUGGER) $(DEQP_DIR)/deqp-vk -n $(debug)
else
cts: $(LIBRARY) $(TEST_LIST)
2018-05-04 11:04:33 +10:00
($(DEQP) --deqp-caselist-file=$(TEST_LIST))
2018-04-02 11:45:52 +10:00
python $(CTS_DIR)/scripts/log/log_to_xml.py TestResults.qpa conformance/last.xml
mv TestResults.qpa conformance/last.qpa
firefox conformance/last.xml
2018-05-31 11:27:34 +10:00
endif #debug
endif #pick
2018-04-07 00:42:38 +10:00
clean:
2017-09-07 11:34:41 +10:00
rm -f $(OBJECTS) $(TARGET) $(BINDING)
cargo clean
2018-04-27 07:55:06 +10:00
2018-05-13 11:17:49 +10:00
cherry: $(TARGET)
cd $(CHERRY_DIR) && rm -f Cherry.db && RUST_LOG=warn LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) go run server.go