2017-09-07 11:34:41 +10:00
|
|
|
CC=gcc
|
|
|
|
CFLAGS=
|
|
|
|
DEPS=
|
|
|
|
LDFLAGS=-lpthread -ldl -lm
|
|
|
|
|
2017-09-07 07:10:25 +10:00
|
|
|
HEADER=native/vulkan/vulkan.h
|
2017-09-07 11:34:41 +10:00
|
|
|
BINDING=target/vulkan.rs
|
|
|
|
NATIVE_DIR=target/native
|
|
|
|
TARGET=$(NATIVE_DIR)/test
|
|
|
|
OBJECTS=$(NATIVE_DIR)/test.o
|
|
|
|
LIBRARY=target/debug/libportability.a
|
2017-09-07 07:10:25 +10:00
|
|
|
|
2017-09-07 11:34:41 +10:00
|
|
|
all: $(TARGET)
|
2017-09-07 07:10:25 +10:00
|
|
|
|
2017-09-07 11:34:41 +10:00
|
|
|
$(BINDING): $(HEADER)
|
|
|
|
bindgen --no-layout-tests --rustfmt-bindings $(HEADER) -o $(BINDING)
|
2017-09-07 07:10:25 +10:00
|
|
|
|
2017-09-07 11:34:41 +10:00
|
|
|
$(LIBRARY): $(BINDING) src/*.rs
|
2017-09-07 07:10:25 +10:00
|
|
|
cargo build
|
2017-09-07 11:34:41 +10:00
|
|
|
mkdir -p target/native
|
|
|
|
|
|
|
|
$(NATIVE_DIR)/%.o: native/%.c $(DEPS)
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
2017-09-07 07:10:25 +10:00
|
|
|
|
2017-09-07 11:34:41 +10:00
|
|
|
$(TARGET): $(LIBRARY) $(OBJECTS)
|
|
|
|
$(CC) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(LIBRARY)
|
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
|