1*f0865ec9SKyle EvansROOT_DIR=../../../.. 2*f0865ec9SKyle EvansBUILD_DIR=$(ROOT_DIR)/build 3*f0865ec9SKyle Evansinclude $(ROOT_DIR)/common.mk 4*f0865ec9SKyle Evans 5*f0865ec9SKyle Evans# Remove old includes with bad relative folders 6*f0865ec9SKyle EvansCFLAGS := $(patsubst -I%,,$(CFLAGS)) 7*f0865ec9SKyle Evans# Add proper includes 8*f0865ec9SKyle EvansCFLAGS += -I$(ROOT_DIR)/include/ 9*f0865ec9SKyle Evans 10*f0865ec9SKyle Evansall: kcdsa 11*f0865ec9SKyle Evansifeq ($(WITH_DYNAMIC_LIBS),1) 12*f0865ec9SKyle Evans# If the user asked for dynamic libraries, compile versions of our binaries against them 13*f0865ec9SKyle Evansall: kcdsa_dyn 14*f0865ec9SKyle Evansendif 15*f0865ec9SKyle Evans 16*f0865ec9SKyle Evans# NOTE: avoid a false positive detecting a -Werror=stringop-overflow in kcdsa.c with Wno-error 17*f0865ec9SKyle EvansBIN_CFLAGS += -Wno-error 18*f0865ec9SKyle Evans 19*f0865ec9SKyle Evanslibhash: 20*f0865ec9SKyle Evans # Compile the hashes 21*f0865ec9SKyle Evans $(VERBOSE_MAKE)cd ../../hash && EXTRA_CFLAGS="$(CFLAGS)" make libhash.a 22*f0865ec9SKyle Evans 23*f0865ec9SKyle Evanskcdsa: libhash 24*f0865ec9SKyle Evans $(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*f0865ec9SKyle Evans 26*f0865ec9SKyle Evans# If the user asked for dynamic libraries, compile versions of our binaries against them 27*f0865ec9SKyle Evansifeq ($(WITH_DYNAMIC_LIBS),1) 28*f0865ec9SKyle Evanskcdsa_dyn: libhash 29*f0865ec9SKyle Evans $(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 30*f0865ec9SKyle Evansendif 31*f0865ec9SKyle Evans 32*f0865ec9SKyle Evans 33*f0865ec9SKyle Evansclean: 34*f0865ec9SKyle Evans @rm -f kcdsa 35*f0865ec9SKyle Evans @rm -f kcdsa_dyn 36*f0865ec9SKyle Evans 37*f0865ec9SKyle Evans.PHONY: all clean 16 32 64 debug debug16 debug32 debug64 force_arch32 force_arch64 38