mirror of
https://github.com/italicsjenga/portability.git
synced 2024-11-26 00:41:33 +11:00
38 lines
843 B
Makefile
38 lines
843 B
Makefile
VULKAN_DIR=modules/vulkan-docs/src
|
|
BINDING=target/vulkan.rs
|
|
NATIVE_DIR=target/native
|
|
TARGET=$(NATIVE_DIR)/test
|
|
OBJECTS=$(NATIVE_DIR)/test.o $(NATIVE_DIR)/window.o
|
|
LIBRARY=target/debug/libportability.a
|
|
|
|
CC=g++
|
|
CFLAGS=-std=c++11 -ggdb -O0 -I$(VULKAN_DIR)
|
|
DEPS=
|
|
LDFLAGS=-lpthread -ldl -lm -lX11 -lxcb
|
|
|
|
.PHONY: all binding run
|
|
|
|
all: $(TARGET)
|
|
|
|
binding: $(BINDING)
|
|
|
|
$(BINDING): $(VULKAN_DIR)/vulkan/*.h
|
|
bindgen --no-layout-tests --rustfmt-bindings $(VULKAN_DIR)/vulkan/vulkan.h -o $(BINDING)
|
|
|
|
$(LIBRARY): src/*.rs Cargo.toml $(wildcard Cargo.lock)
|
|
cargo build
|
|
mkdir -p target/native
|
|
|
|
$(NATIVE_DIR)/%.o: native/%.cpp $(DEPS) Makefile
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
$(TARGET): $(LIBRARY) $(OBJECTS) Makefile
|
|
$(CC) -o $(TARGET) $(OBJECTS) $(LIBRARY) $(LDFLAGS)
|
|
|
|
run: $(TARGET)
|
|
$(TARGET)
|
|
|
|
clean:
|
|
rm -f $(OBJECTS) $(TARGET) $(BINDING)
|
|
cargo clean
|