blob: fb5d419e343c814f1a80e1e305441ef23f0cb5ca [file] [log] [blame] [edit]
# Copyright 2010 by Nest Labs, Inc. All rights reserved.
#
# This program is confidential and proprietary to Nest Labs, Inc.,
# and may not be reproduced, published or disclosed to others without
# company authorization.
#
DEPTH = ../../
include $(DEPTH)Makefile.config
OUTDIR = $(OBJ_DIR)
SRCDIR = ./
INCDIR = ./
OBJECT_FILES = \
bn_add \
bn_div \
bn_exp \
bn_lib \
bn_ctx \
bn_mul \
bn_mod \
bn_print \
bn_rand \
bn_shift \
bn_word \
bn_blind \
bn_kron \
bn_sqrt \
bn_gcd \
bn_prime \
bn_err \
bn_sqr \
bn_asm \
bn_recp \
bn_mont \
bn_mpi \
bn_exp2 \
bn_gf2m \
bn_nist \
bn_depr \
bn_const
ifeq ($(BN_MONT_ASM_TYPE), arm)
OBJECT_FILES += bn_mont_mul
endif
HEADER_FILES = \
bn_lcl \
bn_prime
OBJECTS = $(OBJECT_FILES:%=$(OUTDIR)/%.o)
HEADERS = $(HEADER_FILES:%=$(INCDIR)/%.h)
all: $(OUTDIR) $(LIB_DIR)/libbn.a
$(OUTDIR):
$(MKDIR) $(OUTDIR)
clean:
$(RM) $(OUTDIR)
$(OUTDIR)/%.o: $(SRCDIR)/%.c $(HEADERS)
$(CC) $(CFLAGS) -O2 -c -o $@ $<
$(OUTDIR)/%.o: $(SRCDIR)/%.cpp $(HEADERS)
$(CC) $(CFLAGS) -c -o $@ $<
$(OUTDIR)/%.o: $(SRCDIR)/%.S $(HEADERS)
$(CC) $(CFLAGS) -c -o $@ $<
$(OUTDIR)/libbn.a: $(OBJECTS)
$(ARCHIVE) $@ $(OBJECTS)
$(RANLIB) $@
$(LIB_DIR)/libbn.a: $(OUTDIR)/libbn.a
$(MKDIR) $(dir $@)
$(CP) $< $@