From 570e54822c045f848cd3d9d9e317f965be0f6190 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 2 Jan 2024 18:11:10 +0100 Subject: [PATCH] Finish unifying LOCAL_CFLAGS fixup "Create common.make with LOCAL_CFLAGS and friends" The code wasn't what I had intended, although it was functionally equivalent. Make it more readable and more robust. Signed-off-by: Gilles Peskine --- programs/Makefile | 1 - scripts/common.make | 2 +- tests/Makefile | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/programs/Makefile b/programs/Makefile index 64f7cc1a32..50be1763e1 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -3,7 +3,6 @@ MBEDTLS_TEST_PATH = ../tests # code which is in the src/test_helpers subdirectory. MBEDTLS_TEST_OBJS = $(patsubst %.c,%.o,$(wildcard ${MBEDTLS_TEST_PATH}/src/*.c ${MBEDTLS_TEST_PATH}/src/drivers/*.c)) -LOCAL_CFLAGS = $(WARNING_CFLAGS) -I$(MBEDTLS_TEST_PATH)/include -I../include -D_FILE_OFFSET_BITS=64 include ../scripts/common.make ifeq ($(shell uname -s),Linux) diff --git a/scripts/common.make b/scripts/common.make index 2f27d0ef52..b115076f89 100644 --- a/scripts/common.make +++ b/scripts/common.make @@ -5,7 +5,7 @@ WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral WARNING_CXXFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral LDFLAGS ?= -LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../tests/include -I../include -D_FILE_OFFSET_BITS=64 +LOCAL_CFLAGS = $(WARNING_CFLAGS) -I$(MBEDTLS_TEST_PATH)/include -I../include -D_FILE_OFFSET_BITS=64 LOCAL_CXXFLAGS = $(WARNING_CXXFLAGS) -I../include -I../tests/include -D_FILE_OFFSET_BITS=64 LOCAL_LDFLAGS = ${MBEDTLS_TEST_OBJS} \ -L../library \ diff --git a/tests/Makefile b/tests/Makefile index 7a10af271c..848d3c499d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,3 +1,4 @@ +MBEDTLS_TEST_PATH = . include ../scripts/common.make # Set this to -v to see the details of failing test cases @@ -109,7 +110,6 @@ BINARIES := $(addsuffix $(EXEXT),$(APPS)) all: $(BINARIES) -MBEDTLS_TEST_PATH = . MBEDTLS_TEST_OBJS = $(patsubst %.c,%.o,$(wildcard ${MBEDTLS_TEST_PATH}/src/*.c ${MBEDTLS_TEST_PATH}/src/drivers/*.c)) MBEDTLS_TEST_OBJS += $(patsubst %.c,%.o,$(wildcard ${MBEDTLS_TEST_PATH}/src/test_helpers/*.c))