1ROOT_DIR=../../../.. 2BUILD_DIR=$(ROOT_DIR)/build 3include $(ROOT_DIR)/common.mk 4 5# Remove old includes with bad relative folders 6CFLAGS := $(patsubst -I%,,$(CFLAGS)) 7# Add proper includes 8CFLAGS += -I$(ROOT_DIR)/include/ 9 10all: kcdsa 11ifeq ($(WITH_DYNAMIC_LIBS),1) 12# If the user asked for dynamic libraries, compile versions of our binaries against them 13all: kcdsa_dyn 14endif 15 16# NOTE: avoid a false positive detecting a -Werror=stringop-overflow in kcdsa.c with Wno-error 17BIN_CFLAGS += -Wno-error 18 19libhash: 20 # Compile the hashes 21 $(VERBOSE_MAKE)cd ../../hash && EXTRA_CFLAGS="$(CFLAGS)" make libhash.a 22 23kcdsa: libhash 24 $(VERBOSE_MAKE)$(CROSS_COMPILE)$(CC) $(BIN_CFLAGS) -DKCDSA kcdsa.c ../dsa/dsa.c $(ROOT_DIR)/src/external_deps/print.c $(ROOT_DIR)/src/external_deps/rand.c $(BIN_LDFLAGS) ../../hash/libhash.a $(LIBSIGN) -o kcdsa 25 26# If the user asked for dynamic libraries, compile versions of our binaries against them 27ifeq ($(WITH_DYNAMIC_LIBS),1) 28kcdsa_dyn: libhash 29 $(VERBOSE_MAKE)$(CROSS_COMPILE)$(CC) $(BIN_CFLAGS) -DKCDSA kcdsa.c ../dsa/dsa.c $(ROOT_DIR)/src/external_deps/print.c $(ROOT_DIR)/src/external_deps/rand.c $(BIN_LDFLAGS) $(LIBEC) -L$(BUILD_DIR) ../../hash/libhash.a -lsign -o kcdsa_dyn 30endif 31 32 33clean: 34 @rm -f kcdsa 35 @rm -f kcdsa_dyn 36 37.PHONY: all clean 16 32 64 debug debug16 debug32 debug64 force_arch32 force_arch64 38