freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][GSoC-2023-Ahmet] makefile fixed


From: @goksu
Subject: [Git][freetype/freetype][GSoC-2023-Ahmet] makefile fixed
Date: Fri, 16 Jun 2023 20:22:23 +0000

Ahmet Göksu pushed to branch GSoC-2023-Ahmet at FreeType / FreeType

Commits:

  • f5713fa1
    by goksu at 2023-06-16T23:22:07+03:00
    makefile fixed
    

4 changed files:

Changes:

  • builds/testing.mk
    1 1
     # Variables
    
    2 2
     FTBENCH_DIR = $(TOP_DIR)/src/tools/ftbench
    
    3 3
     FTBENCH_SRC = $(FTBENCH_DIR)/ftbench.c
    
    4
    -FTBENCH_BIN = $(FTBENCH_DIR)/bench
    
    5
    -FTBENCH_FLAGS = $(shell pkg-config --cflags freetype2) -lfreetype
    
    4
    +FTBENCH_BIN = $(OBJ_DIR)/bench.o
    
    6 5
     FONTS = $(wildcard $(FTBENCH_DIR)/fonts/*.ttf)
    
    7
    -BASELINES = $(addprefix $(FTBENCH_DIR)/baselines/, $(notdir $(FONTS:.ttf=.txt)))
    
    8
    -BENCHMARKS = $(addprefix $(FTBENCH_DIR)/benchmarks/, $(notdir $(FONTS:.ttf=.txt)))
    
    9
    -PYTHON = python3
    
    6
    +BASELINE = $(addprefix $(FTBENCH_DIR)/baseline/, $(notdir $(FONTS:.ttf=.txt)))
    
    7
    +BENCHMARK = $(addprefix $(FTBENCH_DIR)/benchmark/, $(notdir $(FONTS:.ttf=.txt)))
    
    8
    +BASELINE_DIR = $(FTBENCH_DIR)/baseline/
    
    9
    +BENCHMARK_DIR = $(FTBENCH_DIR)/benchmark/
    
    10 10
     HTMLCREATOR = $(FTBENCH_DIR)/src/tohtml.py
    
    11 11
     HTMLFILE = $(TOP_DIR)/benchmark.html
    
    12 12
     
    
    13
    -# Create directories for baselines and benchmarks
    
    14
    -$(FTBENCH_DIR)/baselines/ $(FTBENCH_DIR)/benchmarks/:
    
    13
    +# Create directories for baseline and benchmark
    
    14
    +$(OBJ_DIR) $(BASELINE_DIR) $(BENCHMARK_DIR):
    
    15
    +	@echo "Creating directory..."
    
    15 16
     	@mkdir -p $@
    
    16 17
     
    
    17 18
     # Build ftbench
    
    18
    -$(FTBENCH_BIN): $(FTBENCH_SRC)
    
    19
    +$(FTBENCH_BIN): $(FTBENCH_SRC) | $(OBJ_DIR)
    
    19 20
     	@echo "Building ftbench..."
    
    20
    -	@gcc $(FTBENCH_FLAGS) $< -o $@
    
    21
    +	@$(CC) -I$(TOP_DIR)/include -lfreetype $< -o $@
    
    21 22
     
    
    22 23
     # Create a baseline
    
    23 24
     .PHONY: baseline
    
    24
    -baseline: $(FTBENCH_BIN) $(FTBENCH_DIR)/baselines/
    
    25
    +baseline: $(FTBENCH_BIN) $(BASELINE_DIR)
    
    25 26
     	@echo "Creating baseline..."
    
    26 27
     	@$(foreach font, $(FONTS), \
    
    27
    -		$(FTBENCH_BIN) $(font) > $(FTBENCH_DIR)/baselines/$(notdir $(font:.ttf=.txt)); \
    
    28
    +		$(FTBENCH_BIN) $(font) > $(BASELINE_DIR)$(notdir $(font:.ttf=.txt)); \
    
    28 29
     	)
    
    29 30
     	@echo "Baseline created."
    
    30 31
     
    
    31 32
     # Benchmark and compare to baseline
    
    32 33
     .PHONY: benchmark
    
    33
    -benchmark: $(FTBENCH_BIN) $(FTBENCH_DIR)/benchmarks/
    
    34
    +benchmark: $(FTBENCH_BIN) $(BENCHMARK_DIR)
    
    34 35
     	@echo "Creating benchmark..."
    
    35 36
     	@$(foreach font, $(FONTS), \
    
    36
    -		$(FTBENCH_BIN) $(font) > $(FTBENCH_DIR)/benchmarks/$(notdir $(font:.ttf=.txt)); \
    
    37
    +		$(FTBENCH_BIN) $(font) > $(BENCHMARK_DIR)$(notdir $(font:.ttf=.txt)); \
    
    37 38
     	)
    
    38 39
     	@$(PYTHON) $(HTMLCREATOR) > $(HTMLFILE)
    
    39 40
     	@echo "Benchmark created."
    
    ... ... @@ -41,6 +42,6 @@ benchmark: $(FTBENCH_BIN) $(FTBENCH_DIR)/benchmarks/
    41 42
     .PHONY: clean-benchmark
    
    42 43
     clean-benchmark:
    
    43 44
     	@echo "Cleaning..."
    
    44
    -	@rm -f $(FTBENCH_BIN)
    
    45
    -	@rm -rf $(FTBENCH_DIR)/baselines/ $(FTBENCH_DIR)/benchmarks/ $(HTMLFILE)
    
    45
    +	@$(RM) $(FTBENCH_BIN)
    
    46
    +	@$(RM) -rf $(BASELINE_DIR) $(BENCHMARK_DIR) $(HTMLFILE) 
    
    46 47
     	@echo "Cleaned."

  • src/tools/ftbench/fonts/deactivated/Roboto_subset.ttfsrc/tools/ftbench/fonts/Roboto_subset.ttf
    No preview for this file type
  • src/tools/ftbench/fonts/tool/sub.sh
    1
    +#!/bin/bash
    
    2
    +
    
    3
    +# Define the Unicode range
    
    4
    +unicodes="U+0021-007E"
    
    5
    +
    
    6
    +# Loop over all .ttf files in the current directory
    
    7
    +for fontfile in *.ttf
    
    8
    +do
    
    9
    +  # Generate the output filename
    
    10
    +  output="${fontfile%.ttf}_subset.ttf"
    
    11
    +
    
    12
    +  # Run the pyftsubset command
    
    13
    +  pyftsubset "$fontfile" --unicodes=$unicodes --output-file="$output"
    
    14
    +done
    
    15
    +

  • src/tools/ftbench/src/tohtml.py
    ... ... @@ -11,9 +11,9 @@ with open('../../../../benchmark.html', 'w') as f:
    11 11
         f.write('<h1>Benchmark Results</h1>\n')
    
    12 12
     
    
    13 13
         # Traverse through the 'baselines' directory
    
    14
    -    for filename in os.listdir('../baselines'):
    
    15
    -        baseline_filepath = os.path.join('../baselines', filename)
    
    16
    -        benchmark_filepath = os.path.join('../benchmarks', filename)
    
    14
    +    for filename in os.listdir('../baseline'):
    
    15
    +        baseline_filepath = os.path.join('../baseline', filename)
    
    16
    +        benchmark_filepath = os.path.join('../benchmark', filename)
    
    17 17
     
    
    18 18
             # Process the baseline file
    
    19 19
             with open(baseline_filepath, 'r') as baseline_file:
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]