xref: /freebsd/crypto/libecc/src/examples/sig/sdsa/Makefile (revision f0865ec9906d5a18fa2a3b61381f22ce16e606ad)
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:	sdsa
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:	sdsa_dyn
14*f0865ec9SKyle Evansendif
15*f0865ec9SKyle Evans
16*f0865ec9SKyle Evanslibhash:
17*f0865ec9SKyle Evans	# Compile the hashes
18*f0865ec9SKyle Evans	$(VERBOSE_MAKE)cd ../../hash && EXTRA_CFLAGS="$(CFLAGS)" make libhash.a
19*f0865ec9SKyle Evans
20*f0865ec9SKyle Evanssdsa: libhash
21*f0865ec9SKyle Evans	$(VERBOSE_MAKE)$(CROSS_COMPILE)$(CC) $(BIN_CFLAGS) -DSDSA sdsa.c ../../hash/hash.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 sdsa
22*f0865ec9SKyle Evans
23*f0865ec9SKyle Evans# If the user asked for dynamic libraries, compile versions of our binaries against them
24*f0865ec9SKyle Evansifeq ($(WITH_DYNAMIC_LIBS),1)
25*f0865ec9SKyle Evanssdsa_dyn: libhash
26*f0865ec9SKyle Evans	$(VERBOSE_MAKE)$(CROSS_COMPILE)$(CC) $(BIN_CFLAGS) -DSDSA sdsa.c ../../hash/hash.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 sdsa_dyn
27*f0865ec9SKyle Evansendif
28*f0865ec9SKyle Evans
29*f0865ec9SKyle Evans
30*f0865ec9SKyle Evansclean:
31*f0865ec9SKyle Evans	@rm -f sdsa
32*f0865ec9SKyle Evans	@rm -f sdsa_dyn
33*f0865ec9SKyle Evans
34*f0865ec9SKyle Evans.PHONY: all clean 16 32 64 debug debug16 debug32 debug64 force_arch32 force_arch64
35