2017-09-07 12:01:58 +10:00
|
|
|
VULKAN_DIR=modules/vulkan-docs/src
|
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-01-03 03:39:02 +11:00
|
|
|
LIBRARY=target/debug/libportability.so
|
2017-09-07 07:10:25 +10:00
|
|
|
|
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=
|
2017-12-08 08:29:14 +11:00
|
|
|
LDFLAGS=-lpthread -ldl -lm -lX11 -lxcb
|
2017-09-07 12:01:58 +10:00
|
|
|
|
2017-09-13 02:27:01 +10:00
|
|
|
.PHONY: all binding run
|
|
|
|
|
2017-09-07 11:34:41 +10:00
|
|
|
all: $(TARGET)
|
2017-09-07 07:10:25 +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)
|
2017-09-07 07:10:25 +10:00
|
|
|
|
2017-12-09 09:20:02 +11:00
|
|
|
$(LIBRARY): libportability/src/*.rs libportability-gfx/src/*.rs Cargo.toml $(wildcard Cargo.lock)
|
2018-01-03 03:39:02 +11:00
|
|
|
cargo build --manifest-path libportability/Cargo.toml --features vulkan
|
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-09-07 07:10:25 +10:00
|
|
|
|
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 07:10:25 +10:00
|
|
|
|
2017-09-07 11:34:41 +10:00
|
|
|
run: $(TARGET)
|
|
|
|
$(TARGET)
|
2017-09-07 07:10:25 +10:00
|
|
|
|
|
|
|
clean:
|
2017-09-07 11:34:41 +10:00
|
|
|
rm -f $(OBJECTS) $(TARGET) $(BINDING)
|
|
|
|
cargo clean
|