xref: /freebsd/crypto/libecc/src/examples/Makefile (revision f0865ec9906d5a18fa2a3b61381f22ce16e606ad)
1ROOT_DIR=../..
2BUILD_DIR=$(ROOT_DIR)/build
3include $(ROOT_DIR)/common.mk
4
5# Basic examples directory
6BASIC_DIR=basic/
7# Hash functions directory
8HASH_DIR=hash/
9# Signature functions directory
10SIG_DIR=sig/
11# Shamir Secret Sharing directory
12SSS_DIR=sss/
13
14CFLAGS += -I$(ROOT_DIR)/include/
15
16all:	_basic _hash _sig _sss
17ifeq ($(WITH_DYNAMIC_LIBS),1)
18# If the user asked for dynamic libraries, compile versions of our binaries against them
19all:	_basic_dync _hash_dyn _sig_dyn _sss_dyn
20endif
21
22_basic:
23	$(VERBOSE_MAKE)cd $(BASIC_DIR) && EXTRA_CFLAGS="$(CFLAGS)" make
24_hash:
25	$(VERBOSE_MAKE)cd $(HASH_DIR) && EXTRA_CFLAGS="$(CFLAGS)" make
26_sig:
27	$(VERBOSE_MAKE)cd $(SIG_DIR) && EXTRA_CFLAGS="$(CFLAGS)" make
28_sss:
29	$(VERBOSE_MAKE)cd $(SSS_DIR) && EXTRA_CFLAGS="$(CFLAGS)" make
30
31# If the user asked for dynamic libraries, compile versions of our binaries against them
32ifeq ($(WITH_DYNAMIC_LIBS),1)
33_basic_dync:
34	$(VERBOSE_MAKE)cd $(BASIC_DIR) && EXTRA_CFLAGS="$(CFLAGS)" make
35_hash_dyn:
36	$(VERBOSE_MAKE)cd $(HASH_DIR) && EXTRA_CFLAGS="$(CFLAGS)" make
37_sig_dyn:
38	$(VERBOSE_MAKE)cd $(SIG_DIR) && EXTRA_CFLAGS="$(CFLAGS)" make
39_sss_dyn:
40	$(VERBOSE_MAKE)cd $(SSS_DIR) && EXTRA_CFLAGS="$(CFLAGS)" make
41endif
42
43
44clean:
45	$(VERBOSE_MAKE)cd $(BASIC_DIR) && make clean
46	$(VERBOSE_MAKE)cd $(HASH_DIR) && make clean
47	$(VERBOSE_MAKE)cd $(SIG_DIR) && make clean
48	$(VERBOSE_MAKE)cd $(SSS_DIR) && make clean
49
50.PHONY: all clean 16 32 64 debug debug16 debug32 debug64 force_arch32 force_arch64
51