From 1fb442f6cf7330abaa5e02ad5be6ed041cad56e8 Mon Sep 17 00:00:00 2001 From: goksu <25721443+goeksu@users.noreply.github.com> Date: Thu, 20 Jul 2023 14:51:58 +0300 Subject: [PATCH] compiling and linking works as demos --- builds/testing.mk | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/builds/testing.mk b/builds/testing.mk index 0552e23ec..27be14387 100644 --- a/builds/testing.mk +++ b/builds/testing.mk @@ -3,8 +3,8 @@ FTBENCH_DIR = $(TOP_DIR)/src/tools/ftbench FTBENCH_SRC = $(FTBENCH_DIR)/ftbench.c FTBENCH_OBJ = $(OBJ_DIR)/bench.$(SO) FTBENCH_BIN = $(OBJ_DIR)/bench -FTBENCH_FLAG ?= -c 200 -INCLUDES = -I$(TOP_DIR)/include +FTBENCH_FLAG ?= -c 2000 +INCLUDES = $(TOP_DIR)/include FONTS = $(wildcard $(FTBENCH_DIR)/fonts/*.ttf) BASELINE_DIR = $(OBJ_DIR)/baseline/ BENCHMARK_DIR = $(OBJ_DIR)/benchmark/ @@ -15,19 +15,40 @@ BENCHMARK_INFO = $(BENCHMARK_DIR)info.txt HTMLCREATOR = $(FTBENCH_DIR)/src/tohtml.py HTMLFILE = $(OBJ_DIR)/benchmark.html +FT_INCLUDES := $(OBJ_BUILD) \ + $(INCLUDES) + +COMPILE = $(CC) $(ANSIFLAGS) \ + $(INCLUDES:%=$I%) \ + $(CFLAGS) + +ifneq ($(findstring -pedantic,$(COMPILE)),) + ifeq ($(findstring ++,$(CC)),) + COMPILE += -std=c99 + endif +endif + +FTLIB := $(LIB_DIR)/$(LIBRARY).$A + +override CC = $(CCraw) +LINK_CMD = $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) + +EXTRAFLAGS = $DUNIX $DHAVE_POSIX_TERMIOS + +INCLUDES := $(subst /,$(COMPILER_SEP),$(FT_INCLUDES)) + # Create directories for baseline and benchmark $(OBJ_DIR) $(BASELINE_DIR) $(BENCHMARK_DIR): @mkdir -p $@ -# Build ftbench.o -$(FTBENCH_OBJ): $(FTBENCH_SRC) - @echo "Building ftbench object..." - $(CC) $(INCLUDES) -c $< -o $@ - +$(FTBENCH_OBJ): $(FTBENCH_SRC) + $(COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) $(EXTRAFLAGS) + @echo "Object created." + # Build ftbench -$(FTBENCH_BIN): $(FTBENCH_OBJ) +$(FTBENCH_BIN): $(FTBENCH_OBJ) @echo "Linking ftbench..." - $(LIBTOOL) --mode=link gcc -L$(LIB_DIR) -lfreetype $< -o $@ + $(LINK_CMD) $T$(subst /,$(COMPILER_SEP),$@ $<) $(FTLIB) @echo "Built." # Create a baseline @@ -76,4 +97,5 @@ clean-benchmark: @echo "Cleaning..." @$(RM) $(FTBENCH_BIN) $(FTBENCH_OBJ) @$(RM) -rf $(BASELINE_DIR) $(BENCHMARK_DIR) $(HTMLFILE) - @echo "Cleaned." + @echo "Cleaned" +