# rule above for the listed targets.
test-bees-plan.o: CXXFLAGS_EXTRA = $(SECTION_FLAGS)
-$(BEES_PROGRAMS:%=%.o): %.o: %.cc ../makeflags Makefile
+$(BEES_PROGRAMS:%=%.o): %.o: %.cc $(BUILD_CONF) Makefile
$(CXX) $(BEES_CXXFLAGS) -I../src $(CXXFLAGS_EXTRA) -o $@ -c $<
-$(BEES_PROGRAMS:%=%.dep): %.dep: %.cc tests.h Makefile
+$(BEES_PROGRAMS:%=%.dep): %.dep: %.cc tests.h Makefile $(BUILD_CONF)
$(CXX) $(BEES_CXXFLAGS) -I../src -M -MF $@ -MT $*.o $<
# test-bees-borrower links a hand-picked subset (no unity build).
-test-bees-borrower: test-bees-borrower.o ../src/bees-borrower.o ../src/bees-planner-state.o ../src/bees-trace.o ../src/bees-log.o ../makeflags Makefile ../lib/libcrucible.a
+test-bees-borrower: test-bees-borrower.o ../src/bees-borrower.o ../src/bees-planner-state.o ../src/bees-trace.o ../src/bees-log.o $(BUILD_CONF) Makefile ../lib/libcrucible.a
$(CXX) $(BEES_CXXFLAGS) $(BEES_LDFLAGS) -o $@ test-bees-borrower.o ../src/bees-borrower.o ../src/bees-planner-state.o ../src/bees-trace.o ../src/bees-log.o $(LIBS)
# test-bees-filter includes ../src/bees-filter.cc directly (unity build), so it
# needs nothing extra from the daemon at link time.
-test-bees-filter: test-bees-filter.o ../makeflags Makefile ../lib/libcrucible.a
+test-bees-filter: test-bees-filter.o $(BUILD_CONF) Makefile ../lib/libcrucible.a
$(CXX) $(BEES_CXXFLAGS) $(BEES_LDFLAGS) -o $@ test-bees-filter.o $(LIBS)
# test-bees-heatmap exercises the BeesHeatmap collector; the collector core is
# header-only and std-only, but print() lives in bees-heatmap.o (it uses
# crucible Table for layout), so the test links that one object from the daemon.
-test-bees-heatmap: test-bees-heatmap.o ../src/bees-heatmap.o ../makeflags Makefile ../lib/libcrucible.a
+test-bees-heatmap: test-bees-heatmap.o ../src/bees-heatmap.o $(BUILD_CONF) Makefile ../lib/libcrucible.a
$(CXX) $(BEES_CXXFLAGS) $(BEES_LDFLAGS) -o $@ test-bees-heatmap.o ../src/bees-heatmap.o $(LIBS)
# test-bees-plan exercises CostReport (the do-nothing cost model) only. It
# operator<<(CostReport) code; those are the only things in bees-plan.cc that
# reference bees-side pretty() and BeesExtent (bytenr/phys_size), so dropping
# them keeps the test from dragging in the rest of the daemon.
-test-bees-plan-lib.o: ../src/bees-plan.cc ../makeflags Makefile
+test-bees-plan-lib.o: ../src/bees-plan.cc $(BUILD_CONF) Makefile
$(CXX) $(BEES_CXXFLAGS) -I../src $(SECTION_FLAGS) -o $@ -c $<
# test-bees-plan-lib.o is a test-local rebuild of ../src/bees-plan.cc, so the
# BeesRewritePolicy layout) would leave this object stale and link it against a
# freshly built test-bees-plan.o: an ABI mismatch that silently corrupts the
# cost model. Generate and include its header dependencies explicitly.
-test-bees-plan-lib.dep: ../src/bees-plan.cc ../makeflags Makefile
+test-bees-plan-lib.dep: ../src/bees-plan.cc $(BUILD_CONF) Makefile
$(CXX) $(BEES_CXXFLAGS) -I../src -M -MF $@ -MT test-bees-plan-lib.o $<
-include test-bees-plan-lib.dep
# it and pulls in unresolved bees-side deps (BeesNote, bees_log_emit, pretty,
# BeesFileRange::fid) — breaking the gcc build. The sectioned rebuild keeps only
# BeesStats on both toolchains. Mirrors test-bees-plan-lib.o's header-dep rule.
-test-bees-util-lib.o: ../src/bees-util.cc ../makeflags Makefile
+test-bees-util-lib.o: ../src/bees-util.cc $(BUILD_CONF) Makefile
$(CXX) $(BEES_CXXFLAGS) -I../src $(SECTION_FLAGS) -o $@ -c $<
-test-bees-util-lib.dep: ../src/bees-util.cc ../makeflags Makefile
+test-bees-util-lib.dep: ../src/bees-util.cc $(BUILD_CONF) Makefile
$(CXX) $(BEES_CXXFLAGS) -I../src -M -MF $@ -MT test-bees-util-lib.o $<
-include test-bees-util-lib.dep
-test-bees-plan: test-bees-plan.o test-bees-plan-lib.o test-bees-util-lib.o ../makeflags Makefile ../lib/libcrucible.a
+test-bees-plan: test-bees-plan.o test-bees-plan-lib.o test-bees-util-lib.o $(BUILD_CONF) Makefile ../lib/libcrucible.a
$(CXX) $(BEES_CXXFLAGS) $(SECTION_FLAGS) $(BEES_LDFLAGS) -Wl,--gc-sections -o $@ test-bees-plan.o test-bees-plan-lib.o test-bees-util-lib.o $(LIBS)
# bench-bees-plan is a manual scaling/timing harness for the shortest-path
# coverage search (not a pass/fail test, so deliberately NOT in PROGRAMS and
# not run by `make test`). Build on demand: `make bench-bees-plan`, then e.g.
# `./bench-bees-plan 500 4096 64`. Reuses test-bees-plan-lib.o.
-bench-bees-plan.o: bench-bees-plan.cc ../makeflags Makefile
+bench-bees-plan.o: bench-bees-plan.cc $(BUILD_CONF) Makefile
$(CXX) $(BEES_CXXFLAGS) -I../src $(SECTION_FLAGS) -o $@ -c $<
# bench-bees-plan is not in PROGRAMS, so its header dependencies are not tracked
# by the generic %.dep rule; track them explicitly like test-bees-plan-lib.o
# above, so a header change (e.g. bees.h's BeesRewritePolicy layout) rebuilds it.
-bench-bees-plan.dep: bench-bees-plan.cc ../makeflags Makefile
+bench-bees-plan.dep: bench-bees-plan.cc $(BUILD_CONF) Makefile
$(CXX) $(BEES_CXXFLAGS) -I../src -M -MF $@ -MT bench-bees-plan.o $<
-include bench-bees-plan.dep
# Links test-bees-util-lib.o for the same BEESCOUNT symbols test-bees-plan needs
# (bench-bees-plan.o pulls the same instrumented test-bees-plan-lib.o).
-bench-bees-plan: bench-bees-plan.o test-bees-plan-lib.o test-bees-util-lib.o ../makeflags Makefile ../lib/libcrucible.a
+bench-bees-plan: bench-bees-plan.o test-bees-plan-lib.o test-bees-util-lib.o $(BUILD_CONF) Makefile ../lib/libcrucible.a
$(CXX) $(BEES_CXXFLAGS) $(SECTION_FLAGS) $(BEES_LDFLAGS) -Wl,--gc-sections -o $@ bench-bees-plan.o test-bees-plan-lib.o test-bees-util-lib.o $(LIBS)
-$(REPL_TESTS): %: %.o $(REPL_OBJS) ../makeflags Makefile ../lib/libcrucible.a
+$(REPL_TESTS): %: %.o $(REPL_OBJS) $(BUILD_CONF) Makefile ../lib/libcrucible.a
$(CXX) $(BEES_CXXFLAGS) $(BEES_LDFLAGS) -o $@ $< $(REPL_OBJS) $(LIBS)
clean: