1
0
mirror of https://github.com/projectatomic/rpm-ostree.git synced 2026-02-05 09:45:27 +01:00
Files
rpm-ostree/Makefile.bindings
Colin Walters 7a0f58e537 Use default all rule for bindings
This makes rebuilding the bindings more obvious.
2022-12-09 15:26:15 -05:00

27 lines
1.1 KiB
Makefile

# This is duplicated with LIBRPMOSTREE_RUST_SRCS because this
# Makefile needs to be independent
binding_rust_sources = $(shell find rust/src/ -name '*.rs') Cargo.toml Cargo.lock
all: rpmostree-cxxrs.h rpmostree-cxxrs.cxx rust/cxx.h
.PHONY: all
rust/cxx.h: Makefile.bindings
./target/cxxbridge/bin/cxxbridge --header | clang-format --assume-filename=$@ >$@.tmp && mv $@.tmp $@
rpmostree-cxxrs.h: $(binding_rust_sources) rust/cxx.h ./target/cxxbridge/bin/cxxbridge
$(AM_V_GEN) if ./target/cxxbridge/bin/cxxbridge rust/src/lib.rs --header | clang-format --assume-filename=$@ > $@.tmp; then \
if test -f $@ && cmp $@.tmp $@ 2>/dev/null; then rm -f $@.tmp; else \
mv $@.tmp $@; \
fi; \
else \
echo cxxbridge failed; exit 1; \
fi
rpmostree-cxxrs.cxx: $(binding_rust_sources) rpmostree-cxxrs.h
$(AM_V_GEN) if ./target/cxxbridge/bin/cxxbridge --include rpmostree-cxxrs.h rust/src/lib.rs | clang-format --assume-filename=$@ > $@.tmp; then \
if test -f $@ && cmp $@.tmp $@ 2>/dev/null; then rm -f $@.tmp; else \
mv $@.tmp $@; \
fi; \
else \
echo cxxbridge failed; exit 1; \
fi