diff options
| author | Sertonix | 2026-04-09 12:02:34 +0200 |
|---|---|---|
| committer | Julien Voisin | 2026-04-13 00:05:57 +0200 |
| commit | 57e658873fe794a654cc773b521dd8fdf3ddd9ed (patch) | |
| tree | 55bc529d50e181fa05f6dd999f37bcf74c02e224 /tests | |
| parent | e7565d67d283ed0ba284fc109d53a9aded6289fc (diff) | |
Use shared COMMON_FLAGS in tests
Fixes CXXFLAGS missing -I../include/ and avoids similar issues to happen
in the future
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Makefile | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/Makefile b/tests/Makefile index 9c2dede..d19e3d8 100644 --- a/tests/Makefile +++ b/tests/Makefile | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | MACHINE := $(shell uname -m) | 1 | MACHINE := $(shell uname -m) |
| 2 | _FORTIFY_SOURCE ?= 3 | 2 | _FORTIFY_SOURCE ?= 3 |
| 3 | CFLAGS ?= -std=gnu99 | 3 | CFLAGS ?= -std=gnu99 |
| 4 | CFLAGS += -I../include/ -D_FORTIFY_SOURCE=$(_FORTIFY_SOURCE) -static -O2 -Wall -Wextra -Werror -Werror=pointer-arith | 4 | COMMON_FLAGS += -I../include/ -D_FORTIFY_SOURCE=$(_FORTIFY_SOURCE) -static -O2 -Wall -Wextra -Werror -Werror=pointer-arith |
| 5 | CFLAGS += -Wno-format -Wno-array-bounds -Wno-shift-count-negative -Wno-unused-variable -Wno-unused-parameter | 5 | COMMON_FLAGS += -Wno-format -Wno-array-bounds -Wno-shift-count-negative -Wno-unused-variable -Wno-unused-parameter |
| 6 | CXXFLAGS += -D_FORTIFY_SOURCE=$(_FORTIFY_SOURCE) -O2 | ||
| 7 | CXXFLAGS += -Wno-format -Wno-array-bounds -Wno-shift-count-negative -Wno-unused-variable -Wno-unused-parameter | ||
| 8 | |||
| 9 | 6 | ||
| 10 | RUNTIME_TARGETS= \ | 7 | RUNTIME_TARGETS= \ |
| 11 | test_FD_CLR_SETSIZE \ | 8 | test_FD_CLR_SETSIZE \ |
| @@ -129,10 +126,10 @@ all: gcc | |||
| 129 | 126 | ||
| 130 | 127 | ||
| 131 | $(RUNTIME_TARGETS): %: %.c | 128 | $(RUNTIME_TARGETS): %: %.c |
| 132 | $(CC) $(CFLAGS) -o $@ $< | 129 | $(CC) $(COMMON_FLAGS) $(CFLAGS) -o $@ $< |
| 133 | 130 | ||
| 134 | cpp: test_compile.cc | 131 | cpp: test_compile.cc |
| 135 | $(CXX) $(CXXFLAGS) test_compile.cc -o ./test_compile_cc | 132 | $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) test_compile.cc -o ./test_compile_cc |
| 136 | timeout 1s ./test_compile_cc 1234567890 2 3 4 5 6 7 8 9 0 >/dev/null && echo "$(EXE) OK" || echo "$(EXE) FAIL"; \ | 133 | timeout 1s ./test_compile_cc 1234567890 2 3 4 5 6 7 8 9 0 >/dev/null && echo "$(EXE) OK" || echo "$(EXE) FAIL"; \ |
| 137 | 134 | ||
| 138 | run: $(RUNTIME_TARGETS) | 135 | run: $(RUNTIME_TARGETS) |
