mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-10 00:00:24 +03:00
Merge pull request #194 from intelfx/work/makefile-nonrecursive
Makefile: do not recursively expand flags (speed up parallel builds considerably)
This commit is contained in:
commit
e962ffb769
15
Makefile
15
Makefile
@ -21,6 +21,10 @@ else
|
|||||||
CARGO_CLEAN_ARGS = --quiet
|
CARGO_CLEAN_ARGS = --quiet
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Prevent recursive expansions of $(CFLAGS) to avoid repeatedly performing
|
||||||
|
# compile tests
|
||||||
|
CFLAGS:=$(CFLAGS)
|
||||||
|
|
||||||
CFLAGS+=-std=gnu11 -O2 -g -MMD -Wall -fPIC \
|
CFLAGS+=-std=gnu11 -O2 -g -MMD -Wall -fPIC \
|
||||||
-Wno-pointer-sign \
|
-Wno-pointer-sign \
|
||||||
-Wno-deprecated-declarations \
|
-Wno-deprecated-declarations \
|
||||||
@ -38,6 +42,9 @@ CFLAGS+=-std=gnu11 -O2 -g -MMD -Wall -fPIC \
|
|||||||
-DNO_BCACHEFS_SYSFS \
|
-DNO_BCACHEFS_SYSFS \
|
||||||
-DVERSION_STRING='"$(VERSION)"' \
|
-DVERSION_STRING='"$(VERSION)"' \
|
||||||
$(EXTRA_CFLAGS)
|
$(EXTRA_CFLAGS)
|
||||||
|
|
||||||
|
# Intenionally not doing the above to $(LDFLAGS) because we rely on
|
||||||
|
# recursive expansion here (CFLAGS is not yet completely built by this line)
|
||||||
LDFLAGS+=$(CFLAGS) $(EXTRA_LDFLAGS)
|
LDFLAGS+=$(CFLAGS) $(EXTRA_LDFLAGS)
|
||||||
|
|
||||||
ifdef CARGO_TOOLCHAIN_VERSION
|
ifdef CARGO_TOOLCHAIN_VERSION
|
||||||
@ -154,11 +161,11 @@ TAGS:
|
|||||||
tags:
|
tags:
|
||||||
ctags -R .
|
ctags -R .
|
||||||
|
|
||||||
SRCS=$(sort $(shell find . -type f ! -path '*/.*/*' -iname '*.c'))
|
SRCS:=$(sort $(shell find . -type f ! -path '*/.*/*' -iname '*.c'))
|
||||||
DEPS=$(SRCS:.c=.d)
|
DEPS:=$(SRCS:.c=.d)
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|
||||||
OBJS=$(SRCS:.c=.o)
|
OBJS:=$(SRCS:.c=.o)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
@echo " [CC] $@"
|
@echo " [CC] $@"
|
||||||
@ -180,7 +187,7 @@ libbcachefs.a: $(filter-out ./tests/%.o, $(OBJS))
|
|||||||
@echo " [AR] $@"
|
@echo " [AR] $@"
|
||||||
$(Q)ar -rc $@ $+
|
$(Q)ar -rc $@ $+
|
||||||
|
|
||||||
RUST_SRCS=$(shell find rust-src/src rust-src/bch_bindgen/src -type f -iname '*.rs')
|
RUST_SRCS:=$(shell find rust-src/src rust-src/bch_bindgen/src -type f -iname '*.rs')
|
||||||
rust-src/target/release/libbcachefs_rust.a: $(RUST_SRCS)
|
rust-src/target/release/libbcachefs_rust.a: $(RUST_SRCS)
|
||||||
$(CARGO_BUILD)
|
$(CARGO_BUILD)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user