Move c_src dirs back to toplevel

We just wanted c sourcefiles out of the top level, not c source
directories.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-01-16 17:00:02 -05:00
parent 06ff8b55b7
commit b5fd066153
408 changed files with 9 additions and 13 deletions

View File

@ -30,7 +30,7 @@ CFLAGS+=-std=gnu11 -O2 -g -MMD -Wall -fPIC \
-Wno-deprecated-declarations \
-fno-strict-aliasing \
-fno-delete-null-pointer-checks \
-Ic_src -Ic_src/include \
-I. -Ic_src -Iinclude -Iraid \
-D_FILE_OFFSET_BITS=64 \
-D_GNU_SOURCE \
-D_LGPL_SOURCE \
@ -171,13 +171,13 @@ OBJS:=$(SRCS:.c=.o)
@echo " [CC] $@"
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
BCACHEFS_DEPS=c_src/libbcachefs.a
BCACHEFS_DEPS=libbcachefs.a
RUST_SRCS:=$(shell find src bch_bindgen/src -type f -iname '*.rs')
bcachefs: $(BCACHEFS_DEPS) $(RUST_SRCS)
$(Q)$(CARGO_BUILD)
c_src/libbcachefs.a: $(filter-out ./tests/%.o, $(OBJS))
libbcachefs.a: $(filter-out ./tests/%.o, $(OBJS))
@echo " [AR] $@"
$(Q)ar -rc $@ $+

View File

@ -19,8 +19,6 @@ fn main() {
.expect("ENV Var 'CARGO_MANIFEST_DIR' Expected")
.into();
let libbcachefs_inc_dir = std::path::Path::new("../c_src");
let bindings = bindgen::builder()
.header(
top_dir
@ -29,11 +27,9 @@ fn main() {
.display()
.to_string(),
)
.clang_arg(format!(
"-I{}",
libbcachefs_inc_dir.join("include").display()
))
.clang_arg(format!("-I{}", libbcachefs_inc_dir.display()))
.clang_arg("-I..")
.clang_arg("-I../c_src")
.clang_arg("-I../include")
.clang_arg("-DZSTD_STATIC_LINKING_ONLY")
.clang_arg("-DNO_BCACHEFS_FS")
.clang_arg("-D_GNU_SOURCE")

View File

@ -1,6 +1,6 @@
fn main() {
println!("cargo:rustc-link-search=c_src");
println!("cargo:rerun-if-changed=c_src/libbcachefs.a");
println!("cargo:rustc-link-search=.");
println!("cargo:rerun-if-changed=libbcachefs.a");
println!("cargo:rustc-link-lib=static:+whole-archive=bcachefs");
println!("cargo:rustc-link-lib=urcu");

Some files were not shown because too many files have changed in this diff Show More