portability/Makefile

77 lines
2.1 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
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=
TEST_LIST=conformance/deqp.txt
TEST_LIST_SOURCE=$(CTS_DIR)/external/vulkancts/mustpass/1.0.3/vk-default.txt
2018-03-02 14:04:47 +11:00
RUST_BACKTRACE:=1
BACKEND:=gl
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
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)
2017-09-07 12:01:58 +10:00
2018-04-02 11:45:52 +10:00
.PHONY: all binding run cts
2017-09-13 02:27:01 +10:00
2017-09-07 11:34:41 +10:00
all: $(TARGET)
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)
$(LIBRARY): libportability/src/*.rs libportability-gfx/src/*.rs Cargo.toml libportability-gfx/Cargo.toml $(wildcard Cargo.lock)
2018-03-02 14:04:47 +11:00
cargo build --manifest-path libportability/Cargo.toml --features $(BACKEND)
2017-09-07 11:34:41 +10:00
mkdir -p target/native
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)
cts: $(TARGET) $(TEST_LIST)
-LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) $(CTS_DIR)/build/external/vulkancts/modules/vulkan/deqp-vk --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-04-07 00:42:38 +10:00
cts-debug: $(TARGET) $(TEST_LIST)
LD_LIBRARY_PATH=$(FULL_LIBRARY_PATH) rust-lldb $(CTS_DIR)/build/external/vulkancts/modules/vulkan/deqp-vk -- --deqp-caselist-file=$(TEST_LIST)
clean:
2017-09-07 11:34:41 +10:00
rm -f $(OBJECTS) $(TARGET) $(BINDING)
cargo clean