diff --git a/crypto_kem/kyber768/clean/Makefile b/crypto_kem/kyber768/clean/Makefile index 1c9cd06c..71607a05 100644 --- a/crypto_kem/kyber768/clean/Makefile +++ b/crypto_kem/kyber768/clean/Makefile @@ -1,12 +1,16 @@ # This Makefile can be used with GNU Make or BSD Make LIB=libkyber768_clean.a +HEADERS=api.h cbd.h indcpa.h ntt.h params.h poly.h polyvec.h reduce.h verify.h OBJECTS=cbd.o indcpa.o kem.o ntt.o poly.o polyvec.o precomp.o reduce.o verify.o CFLAGS=-Wall -Wextra -Wpedantic -Werror -std=c99 -I../../../common $(EXTRAFLAGS) all: $(LIB) +%.o: %.c $(HEADERS) + $(CC) $(CFLAGS) -c -o $@ $< + $(LIB): $(OBJECTS) $(AR) -r $@ $(OBJECTS) diff --git a/crypto_sign/dilithium-iii/clean/Makefile b/crypto_sign/dilithium-iii/clean/Makefile index 8a1c3e9f..3d36d245 100644 --- a/crypto_sign/dilithium-iii/clean/Makefile +++ b/crypto_sign/dilithium-iii/clean/Makefile @@ -1,12 +1,16 @@ # This Makefile can be used with GNU Make or BSD Make LIB=libdilithium-iii_clean.a +HEADERS=api.h ntt.h packing.h params.h poly.h polyvec.h reduce.h rounding.h sign.h OBJECTS=ntt.o packing.o poly.o polyvec.o reduce.o rounding.o sign.o CFLAGS=-Wall -Wextra -Wpedantic -Werror -std=c99 -I../../../common $(EXTRAFLAGS) all: $(LIB) +%.o: %.c $(HEADERS) + $(CC) $(CFLAGS) -c -o $@ $< + $(LIB): $(OBJECTS) $(AR) -r $@ $(OBJECTS) diff --git a/test/Makefile b/test/Makefile index 50939190..24e1c536 100644 --- a/test/Makefile +++ b/test/Makefile @@ -10,6 +10,7 @@ SCHEME_UPPERCASE=$(shell echo $(SCHEME) | tr a-z A-Z | sed 's/-//') COMMON_DIR=../common COMMON_FILES=$(COMMON_DIR)/fips202.c $(COMMON_DIR)/sha2.c +COMMON_HEADERS=$(COMMON_DIR)/fips202.h $(COMMON_DIR)/randombytes.h $(COMMON_DIR)/sha2.h DEST_DIR=../bin CFLAGS=-Wall -Wextra -Wpedantic -Werror -std=c99 -I$(COMMON_DIR) $(EXTRAFLAGS) @@ -20,11 +21,11 @@ all: $(DEST_DIR)/functest_$(SCHEME)_$(IMPLEMENTATION) $(DEST_DIR)/testvectors_$( rebuild-scheme: cd $(SCHEME_DIR) && make -$(DEST_DIR)/functest_$(SCHEME)_$(IMPLEMENTATION): rebuild-scheme crypto_$(TYPE)/functest.c $(COMMON_FILES) $(COMMON_DIR)/randombytes.c +$(DEST_DIR)/functest_$(SCHEME)_$(IMPLEMENTATION): rebuild-scheme crypto_$(TYPE)/functest.c $(COMMON_FILES) $(COMMON_DIR)/randombytes.c $(COMMON_HEADERS) mkdir -p $(DEST_DIR) $(CC) $(CFLAGS) -DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE) -I$(SCHEME_DIR) crypto_$(TYPE)/testvectors.c $(COMMON_FILES) $(COMMON_DIR)/randombytes.c -o $@ -L$(SCHEME_DIR) -l$(SCHEME)_$(IMPLEMENTATION) -$(DEST_DIR)/testvectors_$(SCHEME)_$(IMPLEMENTATION): rebuild-scheme crypto_$(TYPE)/testvectors.c $(COMMON_FILES) $(COMMON_DIR)/notrandombytes.c +$(DEST_DIR)/testvectors_$(SCHEME)_$(IMPLEMENTATION): rebuild-scheme crypto_$(TYPE)/testvectors.c $(COMMON_FILES) $(COMMON_DIR)/notrandombytes.c $(COMMON_HEADERS) mkdir -p $(DEST_DIR) $(CC) $(CFLAGS) -DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE) -I$(SCHEME_DIR) crypto_$(TYPE)/testvectors.c $(COMMON_FILES) $(COMMON_DIR)/notrandombytes.c -o $@ -L$(SCHEME_DIR) -l$(SCHEME)_$(IMPLEMENTATION)