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: rsa 11ifeq ($(WITH_DYNAMIC_LIBS),1) 12# If the user asked for dynamic libraries, compile versions of our binaries against them 13all: rsa_dyn 14endif 15 16libhash: 17 # Compile the hashes 18 $(VERBOSE_MAKE)cd ../../hash && EXTRA_CFLAGS="$(CFLAGS)" make libhash.a 19 20rsa: libhash 21 $(VERBOSE_MAKE)$(CROSS_COMPILE)$(CC) $(BIN_CFLAGS) -DRSA rsa.c $(ROOT_DIR)/src/external_deps/print.c $(ROOT_DIR)/src/external_deps/rand.c $(BIN_LDFLAGS) ../../hash/libhash.a $(LIBSIGN) -o rsa 22 23# If the user asked for dynamic libraries, compile versions of our binaries against them 24ifeq ($(WITH_DYNAMIC_LIBS),1) 25rsa_dyn: libhash 26 # Compile the hashes 27 $(VERBOSE_MAKE)cd ../../hash && EXTRA_CFLAGS="$(CFLAGS)" make _li 28 $(VERBOSE_MAKE)$(CROSS_COMPILE)$(CC) $(BIN_CFLAGS) -DRSA rsa.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 rsa_dyn 29endif 30 31 32clean: 33 @rm -f rsa 34 @rm -f rsa_dyn 35 36.PHONY: all clean 16 32 64 debug debug16 debug32 debug64 force_arch32 force_arch64 37