2018-10-22 14:46:13 +00:00
|
|
|
RUST_BACKTRACE:=1
|
|
|
|
EXCLUDES:=
|
|
|
|
FEATURE_RUST:=
|
|
|
|
FEATURE_NATIVE:=
|
|
|
|
|
|
|
|
ifeq (,$(TARGET))
|
|
|
|
CHECK_TARGET_FLAG=
|
|
|
|
else
|
|
|
|
CHECK_TARGET_FLAG=--target $(TARGET)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
ifeq ($(TARGET),x86_64-pc-windows-gnu)
|
|
|
|
FEATURE_RUST=vulkan
|
|
|
|
FEATURE_NATIVE=gfx-backend-vulkan
|
|
|
|
else
|
|
|
|
FEATURE_RUST=dx12
|
|
|
|
FEATURE_NATIVE=gfx-backend-dx12
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
UNAME_S:=$(shell uname -s)
|
|
|
|
ifeq ($(UNAME_S),Linux)
|
|
|
|
FEATURE_RUST=vulkan
|
|
|
|
FEATURE_NATIVE=gfx-backend-vulkan
|
|
|
|
endif
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
FEATURE_RUST=metal
|
|
|
|
FEATURE_NATIVE=gfx-backend-metal
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2019-02-22 15:26:29 +00:00
|
|
|
.PHONY: all check test doc clear lib-native lib-rust examples-native examples-rust gfx
|
2018-10-22 14:46:13 +00:00
|
|
|
|
2019-02-12 19:58:57 +00:00
|
|
|
all: examples-native examples-rust examples-gfx
|
2018-10-22 14:46:13 +00:00
|
|
|
|
|
|
|
check:
|
|
|
|
cargo check --all
|
|
|
|
|
|
|
|
test:
|
|
|
|
cargo test --all --features "$(FEATURE_NATIVE) $(FEATURE_RUST)"
|
|
|
|
|
|
|
|
doc:
|
|
|
|
cargo doc --all
|
|
|
|
|
|
|
|
clear:
|
2019-01-20 23:46:02 +00:00
|
|
|
cargo clean
|
2018-10-22 14:46:13 +00:00
|
|
|
rm wgpu-bindings/wgpu.h
|
|
|
|
|
|
|
|
lib-native: Cargo.lock wgpu-native/Cargo.toml $(wildcard wgpu-native/**/*.rs)
|
2019-02-26 16:18:31 +00:00
|
|
|
cargo build --manifest-path wgpu-native/Cargo.toml --features "local,$(FEATURE_NATIVE)"
|
2018-10-22 14:46:13 +00:00
|
|
|
|
|
|
|
lib-rust: Cargo.lock wgpu-rs/Cargo.toml $(wildcard wgpu-rs/**/*.rs)
|
|
|
|
cargo build --manifest-path wgpu-rs/Cargo.toml --features $(FEATURE_RUST)
|
|
|
|
|
2019-02-26 02:18:42 +00:00
|
|
|
wgpu-bindings/*.h: Cargo.lock wgpu-bindings/src/*.rs lib-native
|
2019-01-24 17:08:27 +00:00
|
|
|
cargo +nightly-2018-12-27 run --manifest-path wgpu-bindings/Cargo.toml
|
2018-10-22 14:46:13 +00:00
|
|
|
|
2018-12-01 23:01:54 +00:00
|
|
|
examples-native: lib-native wgpu-bindings/wgpu.h $(wildcard wgpu-native/**/*.c)
|
2019-02-12 19:58:57 +00:00
|
|
|
#$(MAKE) -C examples
|
2018-10-22 14:46:13 +00:00
|
|
|
|
|
|
|
examples-rust: lib-rust examples/Cargo.toml $(wildcard wgpu-native/**/*.rs)
|
2019-02-14 19:08:19 +00:00
|
|
|
cargo build --manifest-path examples/Cargo.toml --features $(FEATURE_RUST)
|
2019-02-12 19:58:57 +00:00
|
|
|
|
|
|
|
examples-gfx: lib-rust gfx-examples/Cargo.toml $(wildcard gfx-examples/*.rs)
|
|
|
|
cargo build --manifest-path gfx-examples/Cargo.toml --features $(FEATURE_RUST)
|
2019-02-21 14:49:30 +00:00
|
|
|
|
2019-02-22 15:26:29 +00:00
|
|
|
gfx:
|
|
|
|
cargo run --manifest-path gfx-examples/Cargo.toml --bin $(name) --features $(FEATURE_RUST)
|