Skip to content

Commit c0c2f81

Browse files
committed
fix: resolve make distdir errors
1 parent 21bd9cb commit c0c2f81

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

rust/Makefile.am

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,10 @@ cargo-clean-config:
7777

7878
clean-local: cargo-clean-chirp cxxbridge-clean-chirp clean-librustdeps-la cargo-clean-config
7979

80+
dist-hook: cxxbridge-chirp
81+
$(MKDIR_P) $(distdir)/chirp/gen/src
82+
$(MKDIR_P) $(distdir)/chirp/gen/include/rust/chirp
83+
cp $(LIBRUST_CHIRP_CPP) $(distdir)/chirp/gen/src/
84+
cp $(LIBRUST_CHIRP_H) $(distdir)/chirp/gen/include/rust/chirp/
85+
8086
.PHONY: cargo-build cargo-clean cargo-clean-config

rust/Makefile.chirp.include

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ LIBRUST_CHIRP_GEN_DIR = $(abs_top_builddir)/rust/chirp/gen
1212
LIBRUST_CHIRP_MANIFEST = $(LIBRUST_CHIRP_CRATE_DIR)/Cargo.toml
1313
LIBRUST_CHIRP_CARGO_BUILD_OPTS = $(CARGO_BUILD_OPTS) --manifest-path $(LIBRUST_CHIRP_MANIFEST)
1414

15+
LIBRUST_CHIRP_GEN_SRCDIR = $(top_srcdir)/rust/chirp/gen
16+
1517
LIBRUST_CHIRP_SRCS = \
1618
$(LIBRUST_CHIRP_CRATE_DIR)/src/lib.rs
1719

@@ -29,9 +31,21 @@ LIBRUST_CHIRP_INCLUDES = \
2931

3032
$(LIBRUST_CHIRP_SRCS): ;
3133

32-
$(LIBRUST_CHIRP_H) $(LIBRUST_CHIRP_CPP): $(LIBRUST_CHIRP_SRCS)
34+
$(LIBRUST_CHIRP_CPP): $(LIBRUST_CHIRP_SRCS)
35+
$(AM_V_at)$(MKDIR_P) $(@D)
36+
$(AM_V_GEN)if test -f $(LIBRUST_CHIRP_GEN_SRCDIR)/src/lib.cpp; then \
37+
cp $(LIBRUST_CHIRP_GEN_SRCDIR)/src/lib.cpp $@; \
38+
else \
39+
$(CXXBRIDGE) $< -o $@; \
40+
fi
41+
42+
$(LIBRUST_CHIRP_H): $(LIBRUST_CHIRP_SRCS)
3343
$(AM_V_at)$(MKDIR_P) $(@D)
34-
$(AM_V_GEN)$(CXXBRIDGE) $< $(if $(filter %.h,$@),--header) -o $@
44+
$(AM_V_GEN)if test -f $(LIBRUST_CHIRP_GEN_SRCDIR)/include/rust/chirp/lib.h; then \
45+
cp $(LIBRUST_CHIRP_GEN_SRCDIR)/include/rust/chirp/lib.h $@; \
46+
else \
47+
$(CXXBRIDGE) $< --header -o $@; \
48+
fi
3549

3650
$(LIBRUST_CHIRP): $(LIBRUST_CHIRP_SRCS) $(LIBRUST_CHIRP_BUILD) $(LIBRUST_CHIRP_MANIFEST)
3751
$(AM_V_GEN)$(LIBRUST_CHIRP_CARGO_ENV) $(CARGO) build $(LIBRUST_CHIRP_CARGO_BUILD_OPTS)

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ endif
11981198
libcxxbridge_la_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(PIC_FLAGS)
11991199
libcxxbridge_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) $(PIC_FLAGS) -static
12001200
libcxxbridge_la_LDFLAGS = $(AM_LDFLAGS) -static
1201-
libcxxbridge_la_SOURCES = $(LIBRUSTDEPS_CPP)
1201+
nodist_libcxxbridge_la_SOURCES = $(LIBRUSTDEPS_CPP)
12021202

12031203
$(libcxxbridge_la_OBJECTS): $(LIBRUSTDEPS_H)
12041204
#

0 commit comments

Comments
 (0)