From e9362ecc599574b87a19b7544aa94c5519e38f5b Mon Sep 17 00:00:00 2001 From: goksu <25721443+goeksu@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:18:00 +0300 Subject: [PATCH] linking by gcc --- builds/testing.mk | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/builds/testing.mk b/builds/testing.mk index 960a4fd51..0552e23ec 100644 --- a/builds/testing.mk +++ b/builds/testing.mk @@ -1,7 +1,8 @@ # Variables FTBENCH_DIR = $(TOP_DIR)/src/tools/ftbench FTBENCH_SRC = $(FTBENCH_DIR)/ftbench.c -FTBENCH_BIN = $(OBJ_DIR)/bench.o +FTBENCH_OBJ = $(OBJ_DIR)/bench.$(SO) +FTBENCH_BIN = $(OBJ_DIR)/bench FTBENCH_FLAG ?= -c 200 INCLUDES = -I$(TOP_DIR)/include FONTS = $(wildcard $(FTBENCH_DIR)/fonts/*.ttf) @@ -18,10 +19,15 @@ HTMLFILE = $(OBJ_DIR)/benchmark.html $(OBJ_DIR) $(BASELINE_DIR) $(BENCHMARK_DIR): @mkdir -p $@ +# Build ftbench.o +$(FTBENCH_OBJ): $(FTBENCH_SRC) + @echo "Building ftbench object..." + $(CC) $(INCLUDES) -c $< -o $@ + # Build ftbench -$(FTBENCH_BIN): $(FTBENCH_SRC) | $(OBJ_DIR) - @echo "Building ftbench..." - @$(CC) $(INCLUDES) $< -lfreetype -o $@ +$(FTBENCH_BIN): $(FTBENCH_OBJ) + @echo "Linking ftbench..." + $(LIBTOOL) --mode=link gcc -L$(LIB_DIR) -lfreetype $< -o $@ @echo "Built." # Create a baseline @@ -68,6 +74,6 @@ benchmark: $(FTBENCH_BIN) $(BENCHMARK_DIR) .PHONY: clean-benchmark clean-benchmark: @echo "Cleaning..." - @$(RM) $(FTBENCH_BIN) + @$(RM) $(FTBENCH_BIN) $(FTBENCH_OBJ) @$(RM) -rf $(BASELINE_DIR) $(BENCHMARK_DIR) $(HTMLFILE) @echo "Cleaned."