Skip to content

Commit d994998

Browse files
committed
Make: Support CFLAGS as both env var and make argument
We usually pass arguments to make through environment variables: CFLAGS="-std=c11" make quickcheck It currently does not work to pass it as a make argument: make quickcheck CFLAGS="-std=c11" This commit fixes that and extends the C90 CI to test both variants. Resolves #722 Signed-off-by: Matthias J. Kannwischer <[email protected]>
1 parent dcc95d6 commit d994998

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/base.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,17 @@ jobs:
153153
runs-on: ${{ matrix.target.runner }}
154154
steps:
155155
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
156-
- name: make quickcheck
156+
- name: make quickcheck (CFLAGS as environment variable)
157+
run: |
158+
OPT=0 CFLAGS="-std=c90" make quickcheck
159+
make clean >/dev/null
160+
OPT=1 CFLAGS="-std=c90" make quickcheck
161+
- name: make quickcheck (CFLAGS as make argument)
157162
run: |
158-
OPT=0 CFLAGS=-std=c90 make quickcheck
159163
make clean >/dev/null
160-
OPT=1 CFLAGS=-std=c90 make quickcheck
164+
OPT=0 make quickcheck CFLAGS="-std=c90"
165+
make clean >/dev/null
166+
OPT=1 make quickcheck CFLAGS="-std=c90"
161167
- uses: ./.github/actions/setup-apt
162168
- name: tests func
163169
run: |

test/mk/config.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ CC_AR := $(CROSS_PREFIX)$(CC_AR)
3131
#################
3232
# Common config #
3333
#################
34-
CFLAGS := \
34+
35+
override CFLAGS := \
3536
-Wall \
3637
-Wextra \
3738
-Werror=unused-result \

0 commit comments

Comments
 (0)