Commit 9def743d authored by Davide Galassi's avatar Davide Galassi

Makefile adjustments

parent c1b78edd
......@@ -51,7 +51,7 @@ endif
endif
objs-y :=
objects-y :=
paths-y :=
objects_list :=
......@@ -59,9 +59,9 @@ define include_subdir
$(shell mkdir -p $(call src_to_bin_dir,$1))
subdirs-y :=
current := $1
objs-y :=
objects-y :=
include $1/subdir.mk
objects_list += $$(if $$(objs-y),$$(addprefix $1/,$$(objs-y)))
objects_list += $$(if $$(objects-y),$$(addprefix $1/,$$(objects-y)))
paths-y += $$(current)
subdirs-y := $$(addprefix $$(current)/, $$(subdirs-y))
$$(foreach subdir, $$(subdirs-y),$$(eval $$(call include_subdir,$$(subdir))))
......@@ -72,12 +72,13 @@ $(eval $(call include_subdir,src))
objects = $(call src_to_bin_dir,$(objects_list))
depends = $(patsubst %.o,%.d,$(objects))
CPPFLAGS = $(includes-y)
CFLAGS = $(cflags-y)
AFLAGS = $(aflags-y)
LDFLAGS = $(lflags-y)
CPPFLAGS = $(includes-y)
CFLAGS = $(cflags-y)
AFLAGS = $(aflags-y)
LDFLAGS = $(lflags-y)
DATE := $(shell date +'%y%m%d')
DATE := $(shell date +'%y%m%d')
.PHONY: all cry clean test testclean
......@@ -86,11 +87,10 @@ all: cry
cry: $(target)
clean:
$(RM) $(binary_dir) $(config) *.a
$(RM) `find . -type f \( -name \*.gcda -o -name \*.gcno \)`
@$(RM) $(binary_dir) $(config) *.a
@$(RM) `find . -type f \( -name \*.gcda -o -name \*.gcno \)`
$(objects): $(config)
$(objects): Makefile config.mk $(config)
$(target): $(objects)
$(AR) rcs $@ $^
......
......@@ -114,9 +114,6 @@ void cry_crc16_ibm_init(struct cry_crc16_ctx *ctx);
*/
uint16_t cry_crc16_ibm(const unsigned char *in, size_t n);
/**
* Initialize a generic CRC-32 algoritm context.
*
......
# src/classic/subdir.mk
objs-y := hill.o \
affine.o
objects-y := \
hill.o \
affine.o
\ No newline at end of file
# src/crc/subdir.mk
objs-y := crc16.o \
crc16_ccitt.o \
crc16_ibm.o \
crc32.o \
crc32_eth.o
objects-y := \
crc16.o \
crc16_ccitt.o \
crc16_ibm.o \
crc32.o \
crc32_eth.o
\ No newline at end of file
# src/ecp/subdir.mk
objs-y := ecp_copy.o \
ecp_add.o \
ecp_dbl.o \
ecp_mul.o \
ec_nist_p256.o
objects-y := \
ecp_copy.o \
ecp_add.o \
ecp_dbl.o \
ecp_mul.o \
ec_nist_p256.o
\ No newline at end of file
# src/mpi/subdir.mk
objs-y := mpi_core.o \
mpi_list.o \
mpi_abs.o \
mpi_cmp.o \
mpi_cmp_abs.o \
mpi_add.o \
mpi_add_abs.o \
mpi_sub.o \
mpi_sub_abs.o \
mpi_mul.o \
mpi_mul_abs.o \
mpi_mul_baseline.o \
mpi_mul_comba.o \
mpi_mul_karatsuba.o \
mpi_mul_toom3.o \
mpi_div.o \
mpi_div_abs.o \
mpi_sqr.o \
mpi_sqrt.o \
mpi_shl.o \
mpi_shr.o \
mpi_bin.o \
mpi_str.o \
mpi_exp.o \
mpi_mod_exp.o \
mpi_gcd.o \
mpi_lcm.o \
mpi_inv.o \
mpi_rand.o \
mpi_prime.o \
mpi_print.o
objects-y := \
mpi_core.o \
mpi_list.o \
mpi_abs.o \
mpi_cmp.o \
mpi_cmp_abs.o \
mpi_add.o \
mpi_add_abs.o \
mpi_sub.o \
mpi_sub_abs.o \
mpi_mul.o \
mpi_mul_abs.o \
mpi_mul_baseline.o \
mpi_mul_comba.o \
mpi_mul_karatsuba.o \
mpi_mul_toom3.o \
mpi_div.o \
mpi_div_abs.o \
mpi_sqr.o \
mpi_sqrt.o \
mpi_shl.o \
mpi_shr.o \
mpi_bin.o \
mpi_str.o \
mpi_exp.o \
mpi_mod_exp.o \
mpi_gcd.o \
mpi_lcm.o \
mpi_inv.o \
mpi_rand.o \
mpi_prime.o \
mpi_print.o
\ No newline at end of file
# src/prng/subdir.mk
ifeq ($(CRY_PRNG),posix)
objs-y += prng_posix.o
objects-y += prng_posix.o
else ifeq ($(CRY_PRNG),win)
objs-y += prng_win.o
objects-y += prng_win.o
else ifeq ($(CRY_PRNG),aes)
objs-y += prng_aes.o
objects-y += prng_aes.o
else
objs-y += prng_weak.o
objects-y += prng_weak.o
endif
# src/subdir.mk
objs-y := version.o \
memxor.o \
base64.o \
des.o \
aes.o \
cbc.o \
gcm.o \
ctr.o \
md5.o \
sha256.o \
cmac.o \
hmac.o \
rsa.o \
dh.o \
ecdh.o \
dsa.o \
ecdsa.o \
trivium.o \
misc.o
subdirs-y += mpi crc prng sum ecp classic
objects-y := \
version.o \
memxor.o \
base64.o \
des.o \
aes.o \
cbc.o \
gcm.o \
ctr.o \
md5.o \
sha256.o \
cmac.o \
hmac.o \
rsa.o \
dh.o \
ecdh.o \
dsa.o \
ecdsa.o \
trivium.o \
misc.o
subdirs-y += mpi crc prng sum ecp classic
\ No newline at end of file
# src/sum/subdir.mk
objs-y := cs8.o \
lrc.o
objects-y := \
cs8.o \
lrc.o
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment