Skip to content

Commit

Permalink
Remove CPPFLAGS, use EXTRAFLAGS instead
Browse files Browse the repository at this point in the history
CPPFLAGS was misnamed.
This commit uses EXTRAFLAGS instead.

Signed-off-by: Matthias J. Kannwischer <[email protected]>
  • Loading branch information
mkannwischer committed Dec 22, 2024
1 parent 891c11d commit e1ee192
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: make quickcheck
run: |
OPT=0 CPPFLAGS=-std=c90 make quickcheck
OPT=0 EXTRAFLAGS=-std=c90 make quickcheck
make clean >/dev/null
OPT=1 CPPFLAGS=-std=c90 make quickcheck
OPT=1 EXTRAFLAGS=-std=c90 make quickcheck
- uses: ./.github/actions/setup-apt
- name: tests func
run: |
CPPFLAGS="-std=c90" ./scripts/tests func
EXTRAFLAGS="-std=c90" ./scripts/tests func
- name: check namespacing
run: |
./scripts/ci/check-namespace
Expand Down
2 changes: 1 addition & 1 deletion mk/bench.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
CPPFLAGS += -Itest/hal
EXTRAFLAGS += -Itest/hal
SOURCES += $(wildcard test/hal/*.c)
3 changes: 1 addition & 2 deletions mk/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ CFLAGS += \
-std=c99 \
-pedantic \
-MMD \
$(EXTRAFLAGS) \
$(CPPFLAGS)
$(EXTRAFLAGS)

##################
# Some Variables #
Expand Down
2 changes: 1 addition & 1 deletion mk/crypto.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
CPPFLAGS += -Imlkem/fips202 -Imlkem/fips202/native
EXTRAFLAGS += -Imlkem/fips202 -Imlkem/fips202/native
FIPS202_SRCS = $(wildcard mlkem/fips202/*.c)
ifeq ($(OPT),1)
FIPS202_SRCS += $(wildcard mlkem/fips202/native/aarch64/src/*.S) $(wildcard mlkem/fips202/native/aarch64/src/*.c) $(wildcard mlkem/fips202/native/x86_64/src/*.c)
Expand Down
22 changes: 11 additions & 11 deletions mk/schemes.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
SOURCES += $(wildcard mlkem/*.c) $(wildcard mlkem/debug/*.c)
ifeq ($(OPT),1)
SOURCES += $(wildcard mlkem/native/aarch64/src/*.[csS]) $(wildcard mlkem/native/x86_64/src/*.[csS])
CPPFLAGS += -DMLKEM_USE_NATIVE
EXTRAFLAGS += -DMLKEM_USE_NATIVE
endif

CPPFLAGS += -Imlkem -Imlkem/sys -Imlkem/native -Imlkem/native/aarch64 -Imlkem/native/x86_64
EXTRAFLAGS += -Imlkem -Imlkem/sys -Imlkem/native -Imlkem/native/aarch64 -Imlkem/native/x86_64
ALL_TESTS = test_mlkem acvp_mlkem bench_mlkem bench_components_mlkem gen_NISTKAT gen_KAT
NON_NIST_TESTS = $(filter-out gen_NISTKAT,$(ALL_TESTS))

Expand All @@ -25,9 +25,9 @@ $(BUILD_DIR)/lib$(1).a: $(call MAKE_OBJS,$(BUILD_DIR)/$(1),$(SOURCES))
$(BUILD_DIR)/libmlkem.a: $(BUILD_DIR)/lib$(1).a $(call MAKE_OBJS,$(BUILD_DIR)/$(1),$(SOURCES))
endef

$(BUILD_DIR)/libmlkem512.a: CPPFLAGS += -DMLKEM_K=2
$(BUILD_DIR)/libmlkem768.a: CPPFLAGS += -DMLKEM_K=3
$(BUILD_DIR)/libmlkem1024.a: CPPFLAGS += -DMLKEM_K=4
$(BUILD_DIR)/libmlkem512.a: EXTRAFLAGS += -DMLKEM_K=2
$(BUILD_DIR)/libmlkem768.a: EXTRAFLAGS += -DMLKEM_K=3
$(BUILD_DIR)/libmlkem1024.a: EXTRAFLAGS += -DMLKEM_K=4

# build libmlkem512.a libmlkem768.a libmlkem1024.a
$(foreach scheme,mlkem512 mlkem768 mlkem1024, \
Expand All @@ -39,9 +39,9 @@ $(BUILD_DIR)/$(1)/bin/$(2)$(shell echo $(1) | tr -d -c 0-9): LDLIBS += -L$(BUILD
$(BUILD_DIR)/$(1)/bin/$(2)$(shell echo $(1) | tr -d -c 0-9): $(BUILD_DIR)/$(1)/test/$(2).c.o $(BUILD_DIR)/lib$(1).a
endef

$(MLKEM512_DIR)/bin/%: CPPFLAGS += -DMLKEM_K=2
$(MLKEM768_DIR)/bin/%: CPPFLAGS += -DMLKEM_K=3
$(MLKEM1024_DIR)/bin/%: CPPFLAGS += -DMLKEM_K=4
$(MLKEM512_DIR)/bin/%: EXTRAFLAGS += -DMLKEM_K=2
$(MLKEM768_DIR)/bin/%: EXTRAFLAGS += -DMLKEM_K=3
$(MLKEM1024_DIR)/bin/%: EXTRAFLAGS += -DMLKEM_K=4

$(foreach scheme,mlkem512 mlkem768 mlkem1024, \
$(foreach test,$(ALL_TESTS), \
Expand All @@ -50,11 +50,11 @@ $(foreach scheme,mlkem512 mlkem768 mlkem1024, \
)

# nistkat tests require special RNG
$(MLKEM512_DIR)/bin/gen_NISTKAT512: CPPFLAGS += -Itest/nistrng
$(MLKEM512_DIR)/bin/gen_NISTKAT512: EXTRAFLAGS += -Itest/nistrng
$(MLKEM512_DIR)/bin/gen_NISTKAT512: $(call MAKE_OBJS, $(MLKEM512_DIR), $(wildcard test/nistrng/*.c))
$(MLKEM768_DIR)/bin/gen_NISTKAT768: CPPFLAGS += -Itest/nistrng
$(MLKEM768_DIR)/bin/gen_NISTKAT768: EXTRAFLAGS += -Itest/nistrng
$(MLKEM768_DIR)/bin/gen_NISTKAT768: $(call MAKE_OBJS, $(MLKEM768_DIR), $(wildcard test/nistrng/*.c))
$(MLKEM1024_DIR)/bin/gen_NISTKAT1024: CPPFLAGS += -Itest/nistrng
$(MLKEM1024_DIR)/bin/gen_NISTKAT1024: EXTRAFLAGS += -Itest/nistrng
$(MLKEM1024_DIR)/bin/gen_NISTKAT1024: $(call MAKE_OBJS, $(MLKEM1024_DIR), $(wildcard test/nistrng/*.c))

# All other tests use test-only RNG
Expand Down

0 comments on commit e1ee192

Please sign in to comment.