wgpu/Makefile

70 lines
1.8 KiB
Makefile
Raw Normal View History

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
.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:
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-03-01 04:18:16 +00:00
cargo +nightly 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
gfx:
cargo run --manifest-path gfx-examples/Cargo.toml --bin $(name) --features $(FEATURE_RUST)